How to get text to flash on ssd1306 i2c screen
As approved by the OP, the error was caused by not having reset the cursor to a visible position on the display. The text was written outside of the OLED.

It seems as the clearDisplay() method does not reset the cursor.

The solution is to change the following methods

void testdrawstyles1(void) 
{
  display.clearDisplay();
  display.setCursor(0,0); 
  display.print(F("test1"));
  display.display();
  delay(500);
}

void testdrawstyles2(void) 
{
  display.clearDisplay();
  display.setCursor(0,0); 
  display.print(F("test2"));
  display.display();
  delay(500);
}