MCPcopy Create free account
hub / github.com/Snapchat/Valdi / TEST

Function TEST

valdi/test/runtime/Value_tests.cpp:34–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32};
33
34TEST(Value, canHandleBooleans) {
35 ASSERT_TRUE(Value(true).toBool());
36 ASSERT_FALSE(Value(false).toBool());
37
38 ASSERT_EQ("true", Value(true).toString());
39 ASSERT_EQ("false", Value(false).toString());
40 ASSERT_EQ(Value(true), Value(true));
41 ASSERT_EQ(Value(false), Value(false));
42 ASSERT_NE(Value(false), Value(true));
43
44 ASSERT_TRUE(Value(true).isBool());
45 ASSERT_TRUE(Value(false).isBool());
46
47 auto trueValue = Value(true);
48 auto copy = trueValue;
49 ASSERT_EQ(copy, trueValue);
50 ASSERT_EQ(Value(trueValue), trueValue);
51
52 auto falseValue = Value(false);
53 auto copy2 = falseValue;
54 ASSERT_EQ(copy2, falseValue);
55 ASSERT_EQ(Value(falseValue), falseValue);
56}
57
58TEST(Value, canHandleNumbers) {
59 ASSERT_EQ(0, Value(0).toInt());

Callers

nothing calls this directly

Calls 15

serializeValueFunction · 0.85
deserializeValueFunction · 0.85
isBoolMethod · 0.80
use_countMethod · 0.80
getParameterMethod · 0.80
getMapValueMethod · 0.80
rethrowMethod · 0.80
toStringMethod · 0.65
getMethod · 0.65
getFunctionMethod · 0.65
valueMethod · 0.65
getMapMethod · 0.65

Tested by

no test coverage detected