Generate RTL version of tests

Summary: Generate RTL versions of css-layout tests

Reviewed By: lucasr

Differential Revision: D3863081

fbshipit-source-id: df4debb3c1e371425d7c297f8d013b8042ad1e0e
This commit is contained in:
Emil Sjolander
2016-09-14 08:51:07 -07:00
committed by Facebook Github Bot 0
parent 8fcb265830
commit 21a05417cd
15 changed files with 1251 additions and 126 deletions

View File

@@ -113,12 +113,33 @@ TEST(CSSLayoutTest, justify_content_row_flex_start) {
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
ASSERT_EQ(92, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
ASSERT_EQ(82, CSSNodeLayoutGetLeft(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
ASSERT_EQ(72, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
}
TEST(CSSLayoutTest, justify_content_row_flex_end) {
const CSSNodeRef root = CSSNodeNew();
CSSNodeStyleSetFlexDirection(root, CSSFlexDirectionRow);
CSSNodeStyleSetJustifyContent(root, CSSJustifyFlexEnd);
CSSNodeStyleSetWidth(root, 102);
CSSNodeStyleSetHeight(root, 102);
@@ -140,7 +161,29 @@ TEST(CSSLayoutTest, justify_content_row_flex_end) {
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
ASSERT_EQ(72, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
ASSERT_EQ(92, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
@@ -150,7 +193,7 @@ TEST(CSSLayoutTest, justify_content_row_flex_end) {
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
ASSERT_EQ(92, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(72, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
@@ -195,6 +238,28 @@ TEST(CSSLayoutTest, justify_content_row_center) {
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
ASSERT_EQ(56, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
ASSERT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
ASSERT_EQ(36, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
}
TEST(CSSLayoutTest, justify_content_row_space_between) {
@@ -236,6 +301,28 @@ TEST(CSSLayoutTest, justify_content_row_space_between) {
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
ASSERT_EQ(92, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
ASSERT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
}
TEST(CSSLayoutTest, justify_content_row_space_around) {
@@ -277,6 +364,28 @@ TEST(CSSLayoutTest, justify_content_row_space_around) {
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
ASSERT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
ASSERT_EQ(12, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
}
TEST(CSSLayoutTest, justify_content_column_flex_start) {
@@ -315,11 +424,32 @@ TEST(CSSLayoutTest, justify_content_column_flex_start) {
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
}
TEST(CSSLayoutTest, justify_content_column_flex_end) {
const CSSNodeRef root = CSSNodeNew();
CSSNodeStyleSetJustifyContent(root, CSSJustifyFlexEnd);
CSSNodeStyleSetWidth(root, 102);
CSSNodeStyleSetHeight(root, 102);
@@ -342,17 +472,39 @@ TEST(CSSLayoutTest, justify_content_column_flex_end) {
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(72, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
ASSERT_EQ(82, CSSNodeLayoutGetTop(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(92, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
}
@@ -395,6 +547,28 @@ TEST(CSSLayoutTest, justify_content_column_center) {
ASSERT_EQ(56, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(36, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
ASSERT_EQ(46, CSSNodeLayoutGetTop(root_child1));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(56, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
}
TEST(CSSLayoutTest, justify_content_column_space_between) {
@@ -435,6 +609,28 @@ TEST(CSSLayoutTest, justify_content_column_space_between) {
ASSERT_EQ(92, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
ASSERT_EQ(46, CSSNodeLayoutGetTop(root_child1));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(92, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
}
TEST(CSSLayoutTest, justify_content_column_space_around) {
@@ -475,4 +671,26 @@ TEST(CSSLayoutTest, justify_content_column_space_around) {
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
ASSERT_EQ(12, CSSNodeLayoutGetTop(root_child0));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
ASSERT_EQ(46, CSSNodeLayoutGetTop(root_child1));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child2));
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
}