2 * Copyright (c) 2014-present, Facebook, Inc.
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
8 #include <gtest/gtest.h>
11 TEST(YogaTest, computed_layout_padding) {
12 const YGNodeRef root = YGNodeNew();
13 YGNodeStyleSetWidth(root, 100);
14 YGNodeStyleSetHeight(root, 100);
15 YGNodeStyleSetPaddingPercent(root, YGEdgeStart, 10);
17 YGNodeCalculateLayout(root, 100, 100, YGDirectionLTR);
19 ASSERT_FLOAT_EQ(10, YGNodeLayoutGetPadding(root, YGEdgeLeft));
20 ASSERT_FLOAT_EQ(0, YGNodeLayoutGetPadding(root, YGEdgeRight));
22 YGNodeCalculateLayout(root, 100, 100, YGDirectionRTL);
24 ASSERT_FLOAT_EQ(0, YGNodeLayoutGetPadding(root, YGEdgeLeft));
25 ASSERT_FLOAT_EQ(10, YGNodeLayoutGetPadding(root, YGEdgeRight));
27 YGNodeFreeRecursive(root);