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

Function TEST

valdi/test/runtime/ViewNode_tests.cpp:20–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20TEST(ViewNode, canInsertChildren) {
21 ViewNodeTestsDependencies utils;
22
23 auto root = utils.createLayout();
24 auto child = utils.createLayout();
25 auto child2 = utils.createLayout();
26
27 root->insertChildAt(utils.getViewTransactionScope(), child, 0);
28 root->insertChildAt(utils.getViewTransactionScope(), child2, 1);
29
30 ASSERT_EQ(static_cast<size_t>(2), root->getChildCount());
31
32 ASSERT_EQ(child.get(), root->getChildAt(0));
33 ASSERT_EQ(child2.get(), root->getChildAt(1));
34
35 ASSERT_EQ(2, static_cast<int>(YGNodeGetChildCount(root->getYogaNode())));
36 ASSERT_EQ(child->getYogaNode(), YGNodeGetChild(root->getYogaNode(), 0));
37 ASSERT_EQ(child2->getYogaNode(), YGNodeGetChild(root->getYogaNode(), 1));
38}
39
40TEST(ViewNode, canRemoveChildren) {
41 ViewNodeTestsDependencies utils;

Callers

nothing calls this directly

Calls 15

YGNodeGetChildCountFunction · 0.85
YGNodeGetChildFunction · 0.85
unwrapFunction · 0.85
YGNodeIsDirtyFunction · 0.85
assertVisibleInRangeFunction · 0.85
minFunction · 0.85
UpdateStepClass · 0.85
DummyViewClass · 0.85
createLayoutMethod · 0.80
insertChildAtMethod · 0.80
getYogaNodeMethod · 0.80

Tested by

no test coverage detected