MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/compiler/aot/codegen_test.cc:46–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46TEST(ValidateCppIdent, Simple) {
47 TF_EXPECT_OK(ValidateCppIdent("a", ""));
48 TF_EXPECT_OK(ValidateCppIdent("abc", ""));
49 TF_EXPECT_OK(ValidateCppIdent("_abc", ""));
50 TF_EXPECT_OK(ValidateCppIdent("_abc123", ""));
51 // Make sure we didn't skip a valid letter or digit
52 string ident;
53 for (char c = 'a'; c <= 'z'; c++) {
54 ident.append(1, c);
55 }
56 for (char c = 'A'; c <= 'Z'; c++) {
57 ident.append(1, c);
58 }
59 for (char c = '0'; c <= '9'; c++) {
60 ident.append(1, c);
61 }
62 ident += "_";
63 TF_EXPECT_OK(ValidateCppIdent(ident, ""));
64
65 ExpectErrorContains(ValidateCppIdent("", ""), "empty identifier");
66 ExpectErrorContains(ValidateCppIdent(" ", ""), "illegal leading char");
67 ExpectErrorContains(ValidateCppIdent("0", ""), "illegal leading char");
68 ExpectErrorContains(ValidateCppIdent(".", ""), "illegal leading char");
69 ExpectErrorContains(ValidateCppIdent(":", ""), "illegal leading char");
70 ExpectErrorContains(ValidateCppIdent("a.", ""), "illegal char");
71 ExpectErrorContains(ValidateCppIdent("a:", ""), "illegal char");
72 ExpectErrorContains(ValidateCppIdent("a:", ""), "illegal char");
73}
74
75class ParseCppClassTest : public ::testing::Test {
76 protected:

Callers

nothing calls this directly

Calls 15

ValidateCppIdentFunction · 0.85
MakeShapeFunction · 0.85
GenerateMetadataFunction · 0.85
CompareWithGoldenFileFunction · 0.85
ExpectErrorContainsFunction · 0.70
GenerateHeaderFunction · 0.70
appendMethod · 0.45
add_feedMethod · 0.45
set_nameMethod · 0.45
add_fetchMethod · 0.45
add_variableMethod · 0.45
set_sizeMethod · 0.45

Tested by

no test coverage detected