MCPcopy Create free account
hub / github.com/apache/tvm-ffi / TEST

Function TEST

tests/cpp/test_variant.cc:33–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31using namespace tvm::ffi::testing;
32
33TEST(Variant, Basic) {
34 Variant<int, float> v1 = 1;
35 EXPECT_EQ(v1.get<int>(), 1);
36
37 Variant<int, float> v2 = 2.0f;
38 EXPECT_EQ(v2.get<float>(), 2.0f);
39 v2 = v1;
40 EXPECT_EQ(v2.get<int>(), 1);
41}
42
43TEST(Variant, AnyConvert) {
44 Variant<int, TInt> v = 1;

Callers

nothing calls this directly

Calls 11

TFloatClass · 0.85
ObjectPtrHashClass · 0.85
ObjectPtrEqualClass · 0.85
TIntClass · 0.70
StringClass · 0.50
valueMethod · 0.45
use_countMethod · 0.45
kindMethod · 0.45
messageMethod · 0.45
same_asMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected