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

Function TEST_P

valdi/test/integration/JSIntegrationTests.cpp:82–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80};
81
82TEST_P(JSContextFixture, canRetrieveNumbers) {
83 MAIN_THREAD_INIT();
84 auto wrapper = createWrapper();
85
86 auto value1 = wrapper.evaluateScript("42");
87 auto value2 = wrapper.evaluateScript("120.5");
88 auto value3 = wrapper.evaluateScript("-999999");
89
90 ASSERT_EQ(ValueType::Double, value1.getType());
91 ASSERT_EQ(ValueType::Double, value2.getType());
92 ASSERT_EQ(ValueType::Double, value3.getType());
93
94 ASSERT_DOUBLE_EQ(42.0, value1.toDouble());
95 ASSERT_DOUBLE_EQ(120.5, value2.toDouble());
96 ASSERT_DOUBLE_EQ(-999999, value3.toDouble());
97}
98
99TEST_P(JSContextFixture, canRetrieveError) {
100 MAIN_THREAD_INIT();

Callers

nothing calls this directly

Calls 15

ValueArrayBuilderClass · 0.85
jsValueToValueFunction · 0.85
callFunctionFunction · 0.85
jsValueToFunctionFunction · 0.85
setJsQueuePausedFunction · 0.85
doCreateWrappedObjectFunction · 0.85
withContextRetMethod · 0.80
newNumberMethod · 0.80
newUndefinedMethod · 0.80

Tested by

no test coverage detected