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

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

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