Skip to content

Commit db06cd9

Browse files
jnthntatumcopybara-github
authored andcommitted
Test fix: use hermetic descriptor pool
PiperOrigin-RevId: 954852824
1 parent 7a1c706 commit db06cd9

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

eval/public/structs/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ cc_test(
371371
"//eval/public/testing:matchers",
372372
"//extensions/protobuf:memory_manager",
373373
"//internal:testing",
374+
"//internal:testing_descriptor_pool",
375+
"//internal:testing_message_factory",
374376
"@com_google_absl//absl/status:status_matchers",
375377
"@com_google_cel_spec//proto/cel/expr/conformance/proto3:test_all_types_cc_proto",
376378
"@com_google_protobuf//:protobuf",

eval/public/structs/protobuf_descriptor_type_provider_test.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "eval/public/testing/matchers.h"
2525
#include "extensions/protobuf/memory_manager.h"
2626
#include "internal/testing.h"
27+
#include "internal/testing_descriptor_pool.h"
28+
#include "internal/testing_message_factory.h"
2729
#include "cel/expr/conformance/proto3/test_all_types.pb.h"
2830
#include "google/protobuf/arena.h"
2931
#include "google/protobuf/descriptor.h"
@@ -101,8 +103,8 @@ TEST(ProtobufDescriptorProvider, NotFound) {
101103

102104
TEST(ProtobufDescriptorProvider, FindType) {
103105
ProtobufDescriptorProvider provider(
104-
google::protobuf::DescriptorPool::generated_pool(),
105-
google::protobuf::MessageFactory::generated_factory());
106+
cel::internal::GetTestingDescriptorPool(),
107+
cel::internal::GetTestingMessageFactory());
106108
ASSERT_OK_AND_ASSIGN(std::optional<cel::Type> wrapper_type,
107109
provider.FindType("google.protobuf.Int64Value"));
108110
ASSERT_TRUE(wrapper_type.has_value());

0 commit comments

Comments
 (0)