MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / PodUpdateTest

Function PodUpdateTest

tensorflow/core/framework/variant_test.cc:516–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

514
515template <bool BIG>
516void PodUpdateTest() {
517 struct Pod {
518 int x;
519 float y;
520 char big[BIG ? 256 : 0];
521
522 string TypeName() const { return "POD"; }
523 };
524
525 Variant x = Pod{10, 20.f};
526 EXPECT_NE(x.get<Pod>(), nullptr);
527 EXPECT_EQ(x.TypeName(), "POD");
528 EXPECT_EQ(x.DebugString(), "Variant<type: POD value: ?>");
529
530 x.get<Pod>()->x += x.get<Pod>()->y;
531 EXPECT_EQ(x.get<Pod>()->x, 30);
532}
533
534TEST(VariantTest, PodUpdate) { PodUpdateTest<false>(); }
535

Callers

nothing calls this directly

Calls 2

TypeNameMethod · 0.45
DebugStringMethod · 0.45

Tested by

no test coverage detected