| 206 | }; |
| 207 | |
| 208 | void InitActivation(const TestCase& test_case, google::protobuf::Arena& arena, |
| 209 | Activation& activation) { |
| 210 | for (const auto& [key, value] : test_case.activation) { |
| 211 | if (absl::holds_alternative<Value>(value)) { |
| 212 | activation.InsertOrAssignValue(key, std::get<Value>(value)); |
| 213 | } else { |
| 214 | // Note: This assumes that the TestCase is valid for the given TEST. |
| 215 | // Changes to the activation map will invalidate the pointer to message |
| 216 | // that gets wrapped here. |
| 217 | activation.InsertOrAssignValue( |
| 218 | key, Value::WrapMessageUnsafe( |
| 219 | &std::get<NestedTestAllTypes>(value), |
| 220 | google::protobuf::DescriptorPool::generated_pool(), |
| 221 | google::protobuf::MessageFactory::generated_factory(), &arena)); |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | TEST_P(EvaluatorMemorySafetyTest, Basic) { |
| 227 | const auto& test_case = GetTestCase(); |
no test coverage detected