MCPcopy Create free account
hub / github.com/Tencent/Hippy / TEST

Function TEST

layout/gtest/tests/HPComputedPaddingTest.cpp:20–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18#include <Hippy.h>
19
20TEST(HippyTest, computed_layout_padding) {
21 const HPNodeRef root = HPNodeNew();
22 HPNodeStyleSetWidth(root, 100);
23 HPNodeStyleSetHeight(root, 100);
24 //TODO:: not support percent. ianwang .2018.01.13
25 HPNodeStyleSetPadding(root, CSSStart, 10);
26
27 HPNodeDoLayout(root, 100, 100);
28
29 ASSERT_FLOAT_EQ(10, HPNodeLayoutGetPadding(root, CSSLeft));
30 ASSERT_FLOAT_EQ(0, HPNodeLayoutGetPadding(root, CSSRight));
31
32 HPNodeDoLayout(root, 100, 100, DirectionRTL);
33
34 ASSERT_FLOAT_EQ(0, HPNodeLayoutGetPadding(root, CSSLeft));
35 ASSERT_FLOAT_EQ(10, HPNodeLayoutGetPadding(root, CSSRight));
36
37 HPNodeFreeRecursive(root);
38}

Callers

nothing calls this directly

Calls 7

HPNodeNewFunction · 0.85
HPNodeStyleSetWidthFunction · 0.85
HPNodeStyleSetHeightFunction · 0.85
HPNodeStyleSetPaddingFunction · 0.85
HPNodeDoLayoutFunction · 0.85
HPNodeLayoutGetPaddingFunction · 0.85
HPNodeFreeRecursiveFunction · 0.85

Tested by

no test coverage detected