| 63 | } |
| 64 | |
| 65 | TEST(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 | |
| 86 | TEST(DescriptorDatabase, canFindFileContainingSymbol) { |
| 87 | SimpleExceptionTracker exceptionTracker; |
nothing calls this directly
no test coverage detected