@@ -445,9 +445,7 @@ TEST_F(FirebaseAuthTest, TestTokensAndAuthStateListeners) {
445445#endif
446446
447447static std::string GenerateEmailAddress (const std::string& test_name) {
448- char time_string[22 ];
449- snprintf (time_string, sizeof (time_string), " %lld" ,
450- app_framework::GetCurrentTimeInMicroseconds ());
448+ std::string time_string = std::to_string (app_framework::GetCurrentTimeInMicroseconds ());
451449
452450 std::string sanitized_test_name = test_name;
453451 for (char & c : sanitized_test_name) {
@@ -460,14 +458,11 @@ static std::string GenerateEmailAddress(const std::string& test_name) {
460458 sanitized_test_name = sanitized_test_name.substr (0 , 25 );
461459 }
462460
463- std::string email = " user_" ;
464- email.append (INTEGRATION_TEST_PLATFORM_NAME);
465- email.append (" _" );
466- email.append (sanitized_test_name);
467- email.append (" _" );
468- email.append (time_string);
469- email.append (" @gmail.com" );
461+ std::string email = " user_" + std::string (INTEGRATION_TEST_PLATFORM_NAME) + " _" +
462+ sanitized_test_name + " _" + time_string + " @gmail.com" ;
470463
464+ // The backend generally returns the string as lowercase, so just make it lowercase
465+ // to avoid confusion when comparing later.
471466 std::transform (email.begin (), email.end (), email.begin (),
472467 [](unsigned char c) { return std::tolower (c); });
473468
0 commit comments