src/net/tools/transport_security_state_generator/input_file_parsers_unittest.cc
TEST(InputFileParsersTest, ParseCertificatesFileInvalidName) {
  Pinsets pinsets;

  std::string invalid_name_small_character =
      "startsWithSmallLetter\n"
      "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
  EXPECT_FALSE(ParseCertificatesFile(invalid_name_small_character, &pinsets));

  std::string invalid_name_invalid_characters =
      "Invalid-Characters-In-Name\n"
      "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
  EXPECT_FALSE(
      ParseCertificatesFile(invalid_name_invalid_characters, &pinsets));

  std::string invalid_name_number =
      "1InvalidName\n"
      "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
  EXPECT_FALSE(ParseCertificatesFile(invalid_name_number, &pinsets));

  std::string invalid_name_space =
      "Invalid Name\n"
      "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
  EXPECT_FALSE(ParseCertificatesFile(invalid_name_space, &pinsets));
}
// Test that parsing invalid certificate names fails.
Test that parsing invalid certificate names fails.
Test that parsing invalid certificate names fails .
TEST(InputFileParsersTest, ParseCertificatesFileInvalidName) {
  Pinsets pinsets;
  std::string invalid_name_small_character =
      "startsWithSmallLetter\n"
      "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
  EXPECT_FALSE(ParseCertificatesFile(invalid_name_small_character, &pinsets));
  std::string invalid_name_invalid_characters =
      "Invalid-Characters-In-Name\n"
      "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
  EXPECT_FALSE(
      ParseCertificatesFile(invalid_name_invalid_characters, &pinsets));
  std::string invalid_name_number =
      "1InvalidName\n"
      "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
  EXPECT_FALSE(ParseCertificatesFile(invalid_name_number, &pinsets));
  std::string invalid_name_space =
      "Invalid Name\n"
      "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
  EXPECT_FALSE(ParseCertificatesFile(invalid_name_space, &pinsets));
}
TEST ( InputFileParsersTest , ParseCertificatesFileInvalidName ) { Pinsets pinsets ; std :: string invalid_name_small_character = " \n " " \n " ; EXPECT_FALSE ( ParseCertificatesFile ( invalid_name_small_character , & pinsets ) ) ; std :: string invalid_name_invalid_characters = " \n " " \n " ; EXPECT_FALSE ( ParseCertificatesFile ( invalid_name_invalid_characters , & pinsets ) ) ; std :: string invalid_name_number = " \n " " \n " ; EXPECT_FALSE ( ParseCertificatesFile ( invalid_name_number , & pinsets ) ) ; std :: string invalid_name_space = " \n " " \n " ; EXPECT_FALSE ( ParseCertificatesFile ( invalid_name_space , & pinsets ) ) ; }
Test that parsing invalid certificate names fails.
Test that parsing invalid certificate names fails .