MCPcopy Create free account
hub / github.com/Snapchat/Valdi / TEST

Function TEST

valdi_protobuf/test/DescriptorDatabase_tests.cpp:65–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65TEST(DescriptorDatabase, canFindFileByName) {
66 SimpleExceptionTracker exceptionTracker;
67 Protobuf::DescriptorDatabase database;
68
69 ASSERT_TRUE(registerProtoInDatabase(database, exceptionTracker)) << exceptionTracker.extractError();
70
71 google::protobuf::FileDescriptorProto fileDescriptor;
72
73 ASSERT_TRUE(database.FindFileByName("file1.proto", &fileDescriptor));
74
75 ASSERT_EQ("file1.proto", fileDescriptor.name());
76 ASSERT_EQ("test", fileDescriptor.package());
77
78 ASSERT_TRUE(database.FindFileByName("directory/file2.proto", &fileDescriptor));
79
80 ASSERT_EQ("directory/file2.proto", fileDescriptor.name());
81 ASSERT_EQ("other_package.nested", fileDescriptor.package());
82
83 ASSERT_FALSE(database.FindFileByName("file3.proto", &fileDescriptor));
84}
85
86TEST(DescriptorDatabase, canFindFileContainingSymbol) {
87 SimpleExceptionTracker exceptionTracker;

Callers

nothing calls this directly

Calls 11

registerProtoInDatabaseFunction · 0.85
extractErrorMethod · 0.80
FindFileByNameMethod · 0.80
FindAllFileNamesMethod · 0.80
getAllSymbolNamesMethod · 0.80
nameMethod · 0.65
endMethod · 0.65
toDebugJSONMethod · 0.65
ValueClass · 0.50
beginMethod · 0.45

Tested by

no test coverage detected