|
12 | 12 | // See the License for the specific language governing permissions and |
13 | 13 | // limitations under the License. |
14 | 14 |
|
15 | | -#include "internal/minimal_descriptor_pool.h" |
| 15 | +#include "common/minimal_descriptor_pool.h" |
16 | 16 |
|
17 | 17 | #include "internal/testing.h" |
18 | 18 | #include "google/protobuf/descriptor.h" |
19 | 19 |
|
20 | | -namespace cel::internal { |
| 20 | +namespace cel { |
21 | 21 | namespace { |
22 | 22 |
|
23 | 23 | using ::testing::NotNull; |
24 | 24 |
|
25 | | -TEST(MinimalDescriptorPool, NullValue) { |
| 25 | +TEST(GetMinimalDescriptorPool, NullValue) { |
26 | 26 | ASSERT_THAT(GetMinimalDescriptorPool()->FindEnumTypeByName( |
27 | 27 | "google.protobuf.NullValue"), |
28 | 28 | NotNull()); |
29 | 29 | } |
30 | 30 |
|
31 | | -TEST(MinimalDescriptorPool, BoolValue) { |
| 31 | +TEST(GetMinimalDescriptorPool, BoolValue) { |
32 | 32 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
33 | 33 | "google.protobuf.BoolValue"); |
34 | 34 | ASSERT_THAT(desc, NotNull()); |
35 | 35 | EXPECT_EQ(desc->well_known_type(), |
36 | 36 | google::protobuf::Descriptor::WELLKNOWNTYPE_BOOLVALUE); |
37 | 37 | } |
38 | 38 |
|
39 | | -TEST(MinimalDescriptorPool, Int32Value) { |
| 39 | +TEST(GetMinimalDescriptorPool, Int32Value) { |
40 | 40 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
41 | 41 | "google.protobuf.Int32Value"); |
42 | 42 | ASSERT_THAT(desc, NotNull()); |
43 | 43 | EXPECT_EQ(desc->well_known_type(), |
44 | 44 | google::protobuf::Descriptor::WELLKNOWNTYPE_INT32VALUE); |
45 | 45 | } |
46 | 46 |
|
47 | | -TEST(MinimalDescriptorPool, Int64Value) { |
| 47 | +TEST(GetMinimalDescriptorPool, Int64Value) { |
48 | 48 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
49 | 49 | "google.protobuf.Int64Value"); |
50 | 50 | ASSERT_THAT(desc, NotNull()); |
51 | 51 | EXPECT_EQ(desc->well_known_type(), |
52 | 52 | google::protobuf::Descriptor::WELLKNOWNTYPE_INT64VALUE); |
53 | 53 | } |
54 | 54 |
|
55 | | -TEST(MinimalDescriptorPool, UInt32Value) { |
| 55 | +TEST(GetMinimalDescriptorPool, UInt32Value) { |
56 | 56 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
57 | 57 | "google.protobuf.UInt32Value"); |
58 | 58 | ASSERT_THAT(desc, NotNull()); |
59 | 59 | EXPECT_EQ(desc->well_known_type(), |
60 | 60 | google::protobuf::Descriptor::WELLKNOWNTYPE_UINT32VALUE); |
61 | 61 | } |
62 | 62 |
|
63 | | -TEST(MinimalDescriptorPool, UInt64Value) { |
| 63 | +TEST(GetMinimalDescriptorPool, UInt64Value) { |
64 | 64 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
65 | 65 | "google.protobuf.UInt64Value"); |
66 | 66 | ASSERT_THAT(desc, NotNull()); |
67 | 67 | EXPECT_EQ(desc->well_known_type(), |
68 | 68 | google::protobuf::Descriptor::WELLKNOWNTYPE_UINT64VALUE); |
69 | 69 | } |
70 | 70 |
|
71 | | -TEST(MinimalDescriptorPool, FloatValue) { |
| 71 | +TEST(GetMinimalDescriptorPool, FloatValue) { |
72 | 72 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
73 | 73 | "google.protobuf.FloatValue"); |
74 | 74 | ASSERT_THAT(desc, NotNull()); |
75 | 75 | EXPECT_EQ(desc->well_known_type(), |
76 | 76 | google::protobuf::Descriptor::WELLKNOWNTYPE_FLOATVALUE); |
77 | 77 | } |
78 | 78 |
|
79 | | -TEST(MinimalDescriptorPool, DoubleValue) { |
| 79 | +TEST(GetMinimalDescriptorPool, DoubleValue) { |
80 | 80 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
81 | 81 | "google.protobuf.DoubleValue"); |
82 | 82 | ASSERT_THAT(desc, NotNull()); |
83 | 83 | EXPECT_EQ(desc->well_known_type(), |
84 | 84 | google::protobuf::Descriptor::WELLKNOWNTYPE_DOUBLEVALUE); |
85 | 85 | } |
86 | 86 |
|
87 | | -TEST(MinimalDescriptorPool, BytesValue) { |
| 87 | +TEST(GetMinimalDescriptorPool, BytesValue) { |
88 | 88 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
89 | 89 | "google.protobuf.BytesValue"); |
90 | 90 | ASSERT_THAT(desc, NotNull()); |
91 | 91 | EXPECT_EQ(desc->well_known_type(), |
92 | 92 | google::protobuf::Descriptor::WELLKNOWNTYPE_BYTESVALUE); |
93 | 93 | } |
94 | 94 |
|
95 | | -TEST(MinimalDescriptorPool, StringValue) { |
| 95 | +TEST(GetMinimalDescriptorPool, StringValue) { |
96 | 96 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
97 | 97 | "google.protobuf.StringValue"); |
98 | 98 | ASSERT_THAT(desc, NotNull()); |
99 | 99 | EXPECT_EQ(desc->well_known_type(), |
100 | 100 | google::protobuf::Descriptor::WELLKNOWNTYPE_STRINGVALUE); |
101 | 101 | } |
102 | 102 |
|
103 | | -TEST(MinimalDescriptorPool, Any) { |
| 103 | +TEST(GetMinimalDescriptorPool, Any) { |
104 | 104 | const auto* desc = |
105 | 105 | GetMinimalDescriptorPool()->FindMessageTypeByName("google.protobuf.Any"); |
106 | 106 | ASSERT_THAT(desc, NotNull()); |
107 | 107 | EXPECT_EQ(desc->well_known_type(), google::protobuf::Descriptor::WELLKNOWNTYPE_ANY); |
108 | 108 | } |
109 | 109 |
|
110 | | -TEST(MinimalDescriptorPool, Duration) { |
| 110 | +TEST(GetMinimalDescriptorPool, Duration) { |
111 | 111 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
112 | 112 | "google.protobuf.Duration"); |
113 | 113 | ASSERT_THAT(desc, NotNull()); |
114 | 114 | EXPECT_EQ(desc->well_known_type(), |
115 | 115 | google::protobuf::Descriptor::WELLKNOWNTYPE_DURATION); |
116 | 116 | } |
117 | 117 |
|
118 | | -TEST(MinimalDescriptorPool, Timestamp) { |
| 118 | +TEST(GetMinimalDescriptorPool, Timestamp) { |
119 | 119 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
120 | 120 | "google.protobuf.Timestamp"); |
121 | 121 | ASSERT_THAT(desc, NotNull()); |
122 | 122 | EXPECT_EQ(desc->well_known_type(), |
123 | 123 | google::protobuf::Descriptor::WELLKNOWNTYPE_TIMESTAMP); |
124 | 124 | } |
125 | 125 |
|
126 | | -TEST(MinimalDescriptorPool, Value) { |
| 126 | +TEST(GetMinimalDescriptorPool, Value) { |
127 | 127 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
128 | 128 | "google.protobuf.Value"); |
129 | 129 | ASSERT_THAT(desc, NotNull()); |
130 | 130 | EXPECT_EQ(desc->well_known_type(), google::protobuf::Descriptor::WELLKNOWNTYPE_VALUE); |
131 | 131 | } |
132 | 132 |
|
133 | | -TEST(MinimalDescriptorPool, ListValue) { |
| 133 | +TEST(GetMinimalDescriptorPool, ListValue) { |
134 | 134 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
135 | 135 | "google.protobuf.ListValue"); |
136 | 136 | ASSERT_THAT(desc, NotNull()); |
137 | 137 | EXPECT_EQ(desc->well_known_type(), |
138 | 138 | google::protobuf::Descriptor::WELLKNOWNTYPE_LISTVALUE); |
139 | 139 | } |
140 | 140 |
|
141 | | -TEST(MinimalDescriptorPool, Struct) { |
| 141 | +TEST(GetMinimalDescriptorPool, Struct) { |
142 | 142 | const auto* desc = GetMinimalDescriptorPool()->FindMessageTypeByName( |
143 | 143 | "google.protobuf.Struct"); |
144 | 144 | ASSERT_THAT(desc, NotNull()); |
145 | 145 | EXPECT_EQ(desc->well_known_type(), google::protobuf::Descriptor::WELLKNOWNTYPE_STRUCT); |
146 | 146 | } |
147 | 147 |
|
148 | 148 | } // namespace |
149 | | -} // namespace cel::internal |
| 149 | +} // namespace cel |
0 commit comments