Use ASSERT_FLOAT_EQ instead of ASSERT_EQ
Summary: Changes the unit test comparsion to use ```ASSERT_FLOAT_EQ``` instead of ```ASSERT_EQ``` as they check float values. Closes https://github.com/facebook/css-layout/pull/257 Reviewed By: splhack Differential Revision: D4213809 Pulled By: emilsjolander fbshipit-source-id: a79d310840814f26a122e1a0f6db47383b17d7e2
This commit is contained in:
committed by
Facebook Github Bot
parent
49a21e657b
commit
d54f09e32b
@@ -7,6 +7,10 @@
|
|||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
function toFloatString(n) {
|
||||||
|
return n + (Number(n) == n && n % 1 !== 0 ? 'f' : '');
|
||||||
|
}
|
||||||
|
|
||||||
var CPPEmitter = function() {
|
var CPPEmitter = function() {
|
||||||
Emitter.call(this, 'cpp', ' ');
|
Emitter.call(this, 'cpp', ' ');
|
||||||
};
|
};
|
||||||
@@ -47,7 +51,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
|||||||
}},
|
}},
|
||||||
|
|
||||||
AssertEQ:{value:function(v0, v1) {
|
AssertEQ:{value:function(v0, v1) {
|
||||||
this.push('ASSERT_EQ(' + v0 + ', ' + v1 + ');');
|
this.push('ASSERT_FLOAT_EQ(' + toFloatString(v0) + ', ' + v1 + ');');
|
||||||
}},
|
}},
|
||||||
|
|
||||||
CSSAlignAuto:{value:'CSSAlignAuto'},
|
CSSAlignAuto:{value:'CSSAlignAuto'},
|
||||||
@@ -134,7 +138,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
|||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetFlexBasis:{value:function(nodeName, value) {
|
CSSNodeStyleSetFlexBasis:{value:function(nodeName, value) {
|
||||||
this.push('CSSNodeStyleSetFlexBasis(' + nodeName + ', ' + value + ');');
|
this.push('CSSNodeStyleSetFlexBasis(' + nodeName + ', ' + toFloatString(value) + ');');
|
||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetFlexDirection:{value:function(nodeName, value) {
|
CSSNodeStyleSetFlexDirection:{value:function(nodeName, value) {
|
||||||
@@ -142,11 +146,11 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
|||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetFlexGrow:{value:function(nodeName, value) {
|
CSSNodeStyleSetFlexGrow:{value:function(nodeName, value) {
|
||||||
this.push('CSSNodeStyleSetFlexGrow(' + nodeName + ', ' + value + ');');
|
this.push('CSSNodeStyleSetFlexGrow(' + nodeName + ', ' + toFloatString(value) + ');');
|
||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetFlexShrink:{value:function(nodeName, value) {
|
CSSNodeStyleSetFlexShrink:{value:function(nodeName, value) {
|
||||||
this.push('CSSNodeStyleSetFlexShrink(' + nodeName + ', ' + value + ');');
|
this.push('CSSNodeStyleSetFlexShrink(' + nodeName + ', ' + toFloatString(value) + ');');
|
||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetFlexWrap:{value:function(nodeName, value) {
|
CSSNodeStyleSetFlexWrap:{value:function(nodeName, value) {
|
||||||
@@ -154,7 +158,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
|||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetHeight:{value:function(nodeName, value) {
|
CSSNodeStyleSetHeight:{value:function(nodeName, value) {
|
||||||
this.push('CSSNodeStyleSetHeight(' + nodeName + ', ' + value + ');');
|
this.push('CSSNodeStyleSetHeight(' + nodeName + ', ' + toFloatString(value) + ');');
|
||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetJustifyContent:{value:function(nodeName, value) {
|
CSSNodeStyleSetJustifyContent:{value:function(nodeName, value) {
|
||||||
@@ -162,23 +166,23 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
|||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetMargin:{value:function(nodeName, edge, value) {
|
CSSNodeStyleSetMargin:{value:function(nodeName, edge, value) {
|
||||||
this.push('CSSNodeStyleSetMargin(' + nodeName + ', ' + edge + ', ' + value + ');');
|
this.push('CSSNodeStyleSetMargin(' + nodeName + ', ' + edge + ', ' + toFloatString(value) + ');');
|
||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetMaxHeight:{value:function(nodeName, value) {
|
CSSNodeStyleSetMaxHeight:{value:function(nodeName, value) {
|
||||||
this.push('CSSNodeStyleSetMaxHeight(' + nodeName + ', ' + value + ');');
|
this.push('CSSNodeStyleSetMaxHeight(' + nodeName + ', ' + toFloatString(value) + ');');
|
||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetMaxWidth:{value:function(nodeName, value) {
|
CSSNodeStyleSetMaxWidth:{value:function(nodeName, value) {
|
||||||
this.push('CSSNodeStyleSetMaxWidth(' + nodeName + ', ' + value + ');');
|
this.push('CSSNodeStyleSetMaxWidth(' + nodeName + ', ' + toFloatString(value) + ');');
|
||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetMinHeight:{value:function(nodeName, value) {
|
CSSNodeStyleSetMinHeight:{value:function(nodeName, value) {
|
||||||
this.push('CSSNodeStyleSetMinHeight(' + nodeName + ', ' + value + ');');
|
this.push('CSSNodeStyleSetMinHeight(' + nodeName + ', ' + toFloatString(value) + ');');
|
||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetMinWidth:{value:function(nodeName, value) {
|
CSSNodeStyleSetMinWidth:{value:function(nodeName, value) {
|
||||||
this.push('CSSNodeStyleSetMinWidth(' + nodeName + ', ' + value + ');');
|
this.push('CSSNodeStyleSetMinWidth(' + nodeName + ', ' + toFloatString(value) + ');');
|
||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetOverflow:{value:function(nodeName, value) {
|
CSSNodeStyleSetOverflow:{value:function(nodeName, value) {
|
||||||
@@ -186,11 +190,11 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
|||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetPadding:{value:function(nodeName, edge, value) {
|
CSSNodeStyleSetPadding:{value:function(nodeName, edge, value) {
|
||||||
this.push('CSSNodeStyleSetPadding(' + nodeName + ', ' + edge + ', ' + value + ');');
|
this.push('CSSNodeStyleSetPadding(' + nodeName + ', ' + edge + ', ' + toFloatString(value) + ');');
|
||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetPosition:{value:function(nodeName, edge, value) {
|
CSSNodeStyleSetPosition:{value:function(nodeName, edge, value) {
|
||||||
this.push('CSSNodeStyleSetPosition(' + nodeName + ', ' + edge + ', ' + value + ');');
|
this.push('CSSNodeStyleSetPosition(' + nodeName + ', ' + edge + ', ' + toFloatString(value) + ');');
|
||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetPositionType:{value:function(nodeName, value) {
|
CSSNodeStyleSetPositionType:{value:function(nodeName, value) {
|
||||||
@@ -198,6 +202,6 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
|||||||
}},
|
}},
|
||||||
|
|
||||||
CSSNodeStyleSetWidth:{value:function(nodeName, value) {
|
CSSNodeStyleSetWidth:{value:function(nodeName, value) {
|
||||||
this.push('CSSNodeStyleSetWidth(' + nodeName + ', ' + value + ');');
|
this.push('CSSNodeStyleSetWidth(' + nodeName + ', ' + toFloatString(value) + ');');
|
||||||
}},
|
}},
|
||||||
});
|
});
|
||||||
|
@@ -56,27 +56,27 @@ TEST(CSSLayoutTest, absolute_layout_width_height_start_top) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -95,27 +95,27 @@ TEST(CSSLayoutTest, absolute_layout_width_height_end_bottom) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -134,27 +134,27 @@ TEST(CSSLayoutTest, absolute_layout_start_top_end_bottom) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -175,27 +175,27 @@ TEST(CSSLayoutTest, absolute_layout_width_height_start_top_end_bottom) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -219,37 +219,37 @@ TEST(CSSLayoutTest, do_not_clamp_height_of_absolute_node_to_height_of_its_overfl
|
|||||||
CSSNodeInsertChild(root_child0, root_child0_child0, 0);
|
CSSNodeInsertChild(root_child0, root_child0_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(-50, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(-50, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -288,37 +288,37 @@ TEST(CSSLayoutTest, absolute_layout_within_border) {
|
|||||||
CSSNodeInsertChild(root, root_child1, 1);
|
CSSNodeInsertChild(root, root_child1, 1);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -79,67 +79,67 @@ TEST(CSSLayoutTest, align_content_flex_start) {
|
|||||||
CSSNodeInsertChild(root, root_child4, 4);
|
CSSNodeInsertChild(root, root_child4, 4);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child4));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child4));
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetTop(root_child4));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetTop(root_child4));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child4));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child4));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child4));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child4));
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetTop(root_child4));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetTop(root_child4));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child4));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child4));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -177,67 +177,67 @@ TEST(CSSLayoutTest, align_content_flex_end) {
|
|||||||
CSSNodeInsertChild(root, root_child4, 4);
|
CSSNodeInsertChild(root, root_child4, 4);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child4));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child4));
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetTop(root_child4));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetTop(root_child4));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child4));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child4));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child4));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child4));
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetTop(root_child4));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetTop(root_child4));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child4));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child4));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -275,67 +275,67 @@ TEST(CSSLayoutTest, align_content_center) {
|
|||||||
CSSNodeInsertChild(root, root_child4, 4);
|
CSSNodeInsertChild(root, root_child4, 4);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child4));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child4));
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetTop(root_child4));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetTop(root_child4));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child4));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child4));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child4));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child4));
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetTop(root_child4));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetTop(root_child4));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child4));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child4));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -368,67 +368,67 @@ TEST(CSSLayoutTest, align_content_stretch) {
|
|||||||
CSSNodeInsertChild(root, root_child4, 4);
|
CSSNodeInsertChild(root, root_child4, 4);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child4));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child4));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child4));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child4));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child4));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child4));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child4));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child4));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child4));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child4));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child4));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child4));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child4));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -41,27 +41,27 @@ TEST(CSSLayoutTest, align_items_stretch) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -78,27 +78,27 @@ TEST(CSSLayoutTest, align_items_center) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(45, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(45, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(45, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(45, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -115,27 +115,27 @@ TEST(CSSLayoutTest, align_items_flex_start) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -152,27 +152,27 @@ TEST(CSSLayoutTest, align_items_flex_end) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -43,27 +43,27 @@ TEST(CSSLayoutTest, align_self_center) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(45, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(45, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(45, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(45, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -80,27 +80,27 @@ TEST(CSSLayoutTest, align_self_flex_end) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -117,27 +117,27 @@ TEST(CSSLayoutTest, align_self_flex_start) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -155,27 +155,27 @@ TEST(CSSLayoutTest, align_self_flex_end_override_flex_start) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -42,17 +42,17 @@ TEST(CSSLayoutTest, border_no_size) {
|
|||||||
CSSNodeStyleSetBorder(root, CSSEdgeBottom, 10);
|
CSSNodeStyleSetBorder(root, CSSEdgeBottom, 10);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -70,27 +70,27 @@ TEST(CSSLayoutTest, border_container_match_child) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -110,27 +110,27 @@ TEST(CSSLayoutTest, border_flex_child) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -149,27 +149,27 @@ TEST(CSSLayoutTest, border_stretch_child) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -190,27 +190,27 @@ TEST(CSSLayoutTest, border_center_child) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(35, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(35, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(35, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(35, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -25,8 +25,8 @@ TEST(CSSLayoutTest, assert_default_values) {
|
|||||||
ASSERT_EQ(CSSPositionTypeRelative, CSSNodeStyleGetPositionType(root));
|
ASSERT_EQ(CSSPositionTypeRelative, CSSNodeStyleGetPositionType(root));
|
||||||
ASSERT_EQ(CSSWrapNoWrap, CSSNodeStyleGetFlexWrap(root));
|
ASSERT_EQ(CSSWrapNoWrap, CSSNodeStyleGetFlexWrap(root));
|
||||||
ASSERT_EQ(CSSOverflowVisible, CSSNodeStyleGetOverflow(root));
|
ASSERT_EQ(CSSOverflowVisible, CSSNodeStyleGetOverflow(root));
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetFlexGrow(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetFlexGrow(root));
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetFlexShrink(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetFlexShrink(root));
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetFlexBasis(root)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetFlexBasis(root)));
|
||||||
|
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPosition(root, CSSEdgeLeft)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPosition(root, CSSEdgeLeft)));
|
||||||
@@ -36,24 +36,24 @@ TEST(CSSLayoutTest, assert_default_values) {
|
|||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPosition(root, CSSEdgeStart)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPosition(root, CSSEdgeStart)));
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPosition(root, CSSEdgeEnd)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPosition(root, CSSEdgeEnd)));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeLeft));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeLeft));
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeTop));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeTop));
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeRight));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeRight));
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeBottom));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetMargin(root, CSSEdgeBottom));
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetMargin(root, CSSEdgeStart)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetMargin(root, CSSEdgeStart)));
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetMargin(root, CSSEdgeEnd)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetMargin(root, CSSEdgeEnd)));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeLeft));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeLeft));
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeTop));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeTop));
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeRight));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeRight));
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeBottom));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetPadding(root, CSSEdgeBottom));
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPadding(root, CSSEdgeStart)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPadding(root, CSSEdgeStart)));
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPadding(root, CSSEdgeEnd)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetPadding(root, CSSEdgeEnd)));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeLeft));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeLeft));
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeTop));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeTop));
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeRight));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeRight));
|
||||||
ASSERT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeBottom));
|
ASSERT_FLOAT_EQ(0, CSSNodeStyleGetBorder(root, CSSEdgeBottom));
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetBorder(root, CSSEdgeStart)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetBorder(root, CSSEdgeStart)));
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetBorder(root, CSSEdgeEnd)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetBorder(root, CSSEdgeEnd)));
|
||||||
|
|
||||||
@@ -64,10 +64,10 @@ TEST(CSSLayoutTest, assert_default_values) {
|
|||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetMaxWidth(root)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetMaxWidth(root)));
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetMaxHeight(root)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeStyleGetMaxHeight(root)));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetRight(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetRight(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetBottom(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetBottom(root));
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeLayoutGetWidth(root)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeLayoutGetWidth(root)));
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeLayoutGetHeight(root)));
|
ASSERT_TRUE(CSSValueIsUndefined(CSSNodeLayoutGetHeight(root)));
|
||||||
ASSERT_EQ(CSSDirectionInherit, CSSNodeLayoutGetDirection(root));
|
ASSERT_EQ(CSSDirectionInherit, CSSNodeLayoutGetDirection(root));
|
||||||
|
@@ -24,12 +24,12 @@ TEST(CSSLayoutTest, start_overrides) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetRight(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetRight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetRight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetRight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -48,12 +48,12 @@ TEST(CSSLayoutTest, end_overrides) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetRight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetRight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetRight(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetRight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -71,8 +71,8 @@ TEST(CSSLayoutTest, horizontal_overridden) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetRight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetRight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -90,8 +90,8 @@ TEST(CSSLayoutTest, vertical_overridden) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetBottom(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetBottom(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -109,10 +109,10 @@ TEST(CSSLayoutTest, horizontal_overrides_all) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetRight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetRight(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetBottom(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetBottom(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -130,10 +130,10 @@ TEST(CSSLayoutTest, vertical_overrides_all) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetRight(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetRight(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetBottom(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetBottom(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -154,10 +154,10 @@ TEST(CSSLayoutTest, all_overridden) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetRight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetRight(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetBottom(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetBottom(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -68,47 +68,47 @@ TEST(CSSLayoutTest, flex_direction_column_no_height) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -131,47 +131,47 @@ TEST(CSSLayoutTest, flex_direction_row_no_width) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -194,47 +194,47 @@ TEST(CSSLayoutTest, flex_direction_column) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -258,47 +258,47 @@ TEST(CSSLayoutTest, flex_direction_row) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(70, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(70, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -322,47 +322,47 @@ TEST(CSSLayoutTest, flex_direction_column_reverse) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(70, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(70, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(70, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(70, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -386,47 +386,47 @@ TEST(CSSLayoutTest, flex_direction_row_reverse) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(70, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(70, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -68,37 +68,37 @@ TEST(CSSLayoutTest, flex_basis_flex_grow_column) {
|
|||||||
CSSNodeInsertChild(root, root_child1, 1);
|
CSSNodeInsertChild(root, root_child1, 1);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(75, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(75, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(75, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(75, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(25, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(25, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(75, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(75, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(75, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(75, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(25, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(25, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -119,37 +119,37 @@ TEST(CSSLayoutTest, flex_basis_flex_grow_row) {
|
|||||||
CSSNodeInsertChild(root, root_child1, 1);
|
CSSNodeInsertChild(root, root_child1, 1);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(75, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(75, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(75, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(75, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(25, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(25, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(25, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(25, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(75, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(75, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(25, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(25, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -169,37 +169,37 @@ TEST(CSSLayoutTest, flex_basis_flex_shrink_column) {
|
|||||||
CSSNodeInsertChild(root, root_child1, 1);
|
CSSNodeInsertChild(root, root_child1, 1);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -220,37 +220,37 @@ TEST(CSSLayoutTest, flex_basis_flex_shrink_row) {
|
|||||||
CSSNodeInsertChild(root, root_child1, 1);
|
CSSNodeInsertChild(root, root_child1, 1);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -276,47 +276,47 @@ TEST(CSSLayoutTest, flex_shrink_to_zero) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(75, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(75, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(75, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(75, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -343,47 +343,47 @@ TEST(CSSLayoutTest, flex_basis_overrides_main_size) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -402,37 +402,37 @@ TEST(CSSLayoutTest, flex_grow_shrink_at_most) {
|
|||||||
CSSNodeInsertChild(root_child0, root_child0_child0, 0);
|
CSSNodeInsertChild(root_child0, root_child0_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child0_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child0_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -69,57 +69,57 @@ TEST(CSSLayoutTest, wrap_column) {
|
|||||||
CSSNodeInsertChild(root, root_child3, 3);
|
CSSNodeInsertChild(root, root_child3, 3);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -151,57 +151,57 @@ TEST(CSSLayoutTest, wrap_row) {
|
|||||||
CSSNodeInsertChild(root, root_child3, 3);
|
CSSNodeInsertChild(root, root_child3, 3);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(70, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(70, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(70, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(70, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -234,57 +234,57 @@ TEST(CSSLayoutTest, wrap_row_align_items_flex_end) {
|
|||||||
CSSNodeInsertChild(root, root_child3, 3);
|
CSSNodeInsertChild(root, root_child3, 3);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(70, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(70, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(70, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(70, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -317,57 +317,57 @@ TEST(CSSLayoutTest, wrap_row_align_items_center) {
|
|||||||
CSSNodeInsertChild(root, root_child3, 3);
|
CSSNodeInsertChild(root, root_child3, 3);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(5, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(5, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(70, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(70, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(5, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(5, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
ASSERT_EQ(70, CSSNodeLayoutGetLeft(root_child3));
|
ASSERT_FLOAT_EQ(70, CSSNodeLayoutGetLeft(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root_child3));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root_child3));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -94,47 +94,47 @@ TEST(CSSLayoutTest, justify_content_row_flex_start) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(92, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(92, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(82, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(82, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(72, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(72, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -159,47 +159,47 @@ TEST(CSSLayoutTest, justify_content_row_flex_end) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(72, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(72, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(82, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(82, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(92, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(92, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -224,47 +224,47 @@ TEST(CSSLayoutTest, justify_content_row_center) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(36, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(36, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(56, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(56, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(56, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(56, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(36, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(36, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -289,47 +289,47 @@ TEST(CSSLayoutTest, justify_content_row_space_between) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(92, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(92, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(92, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(92, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -354,47 +354,47 @@ TEST(CSSLayoutTest, justify_content_row_space_around) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(12, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(12, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(46, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(12, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(12, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -416,47 +416,47 @@ TEST(CSSLayoutTest, justify_content_column_flex_start) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -480,47 +480,47 @@ TEST(CSSLayoutTest, justify_content_column_flex_end) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(72, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(72, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(82, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(82, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(92, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(92, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(72, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(72, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(82, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(82, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(92, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(92, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -544,47 +544,47 @@ TEST(CSSLayoutTest, justify_content_column_center) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(36, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(36, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(46, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(46, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(56, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(56, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(36, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(36, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(46, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(46, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(56, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(56, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -608,47 +608,47 @@ TEST(CSSLayoutTest, justify_content_column_space_between) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(46, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(46, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(92, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(92, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(46, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(46, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(92, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(92, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -672,47 +672,47 @@ TEST(CSSLayoutTest, justify_content_column_space_around) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(12, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(12, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(46, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(46, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(12, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(12, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(46, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(46, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(102, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -69,27 +69,27 @@ TEST(CSSLayoutTest, margin_start) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -105,27 +105,27 @@ TEST(CSSLayoutTest, margin_top) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -143,27 +143,27 @@ TEST(CSSLayoutTest, margin_end) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -180,27 +180,27 @@ TEST(CSSLayoutTest, margin_bottom) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -217,27 +217,27 @@ TEST(CSSLayoutTest, margin_and_flex_row) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -253,27 +253,27 @@ TEST(CSSLayoutTest, margin_and_flex_column) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -290,27 +290,27 @@ TEST(CSSLayoutTest, margin_and_stretch_row) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -326,27 +326,27 @@ TEST(CSSLayoutTest, margin_and_stretch_column) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -366,37 +366,37 @@ TEST(CSSLayoutTest, margin_with_sibling_row) {
|
|||||||
CSSNodeInsertChild(root, root_child1, 1);
|
CSSNodeInsertChild(root, root_child1, 1);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -415,37 +415,37 @@ TEST(CSSLayoutTest, margin_with_sibling_column) {
|
|||||||
CSSNodeInsertChild(root, root_child1, 1);
|
CSSNodeInsertChild(root, root_child1, 1);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -61,7 +61,7 @@ TEST(CSSLayoutTest, exactly_measure_stretched_child_column) {
|
|||||||
|
|
||||||
ASSERT_EQ(1, constraintList.length);
|
ASSERT_EQ(1, constraintList.length);
|
||||||
|
|
||||||
ASSERT_EQ(100, constraintList.constraints[0].width);
|
ASSERT_FLOAT_EQ(100, constraintList.constraints[0].width);
|
||||||
ASSERT_EQ(CSSMeasureModeExactly, constraintList.constraints[0].widthMode);
|
ASSERT_EQ(CSSMeasureModeExactly, constraintList.constraints[0].widthMode);
|
||||||
|
|
||||||
free(constraintList.constraints);
|
free(constraintList.constraints);
|
||||||
@@ -88,7 +88,7 @@ TEST(CSSLayoutTest, exactly_measure_stretched_child_row) {
|
|||||||
|
|
||||||
ASSERT_EQ(1, constraintList.length);
|
ASSERT_EQ(1, constraintList.length);
|
||||||
|
|
||||||
ASSERT_EQ(100, constraintList.constraints[0].height);
|
ASSERT_FLOAT_EQ(100, constraintList.constraints[0].height);
|
||||||
ASSERT_EQ(CSSMeasureModeExactly, constraintList.constraints[0].heightMode);
|
ASSERT_EQ(CSSMeasureModeExactly, constraintList.constraints[0].heightMode);
|
||||||
|
|
||||||
free(constraintList.constraints);
|
free(constraintList.constraints);
|
||||||
@@ -114,7 +114,7 @@ TEST(CSSLayoutTest, at_most_main_axis_column) {
|
|||||||
|
|
||||||
ASSERT_EQ(1, constraintList.length);
|
ASSERT_EQ(1, constraintList.length);
|
||||||
|
|
||||||
ASSERT_EQ(100, constraintList.constraints[0].height);
|
ASSERT_FLOAT_EQ(100, constraintList.constraints[0].height);
|
||||||
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].heightMode);
|
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].heightMode);
|
||||||
|
|
||||||
free(constraintList.constraints);
|
free(constraintList.constraints);
|
||||||
@@ -141,7 +141,7 @@ TEST(CSSLayoutTest, at_most_cross_axis_column) {
|
|||||||
|
|
||||||
ASSERT_EQ(1, constraintList.length);
|
ASSERT_EQ(1, constraintList.length);
|
||||||
|
|
||||||
ASSERT_EQ(100, constraintList.constraints[0].width);
|
ASSERT_FLOAT_EQ(100, constraintList.constraints[0].width);
|
||||||
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].widthMode);
|
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].widthMode);
|
||||||
|
|
||||||
free(constraintList.constraints);
|
free(constraintList.constraints);
|
||||||
@@ -168,7 +168,7 @@ TEST(CSSLayoutTest, at_most_main_axis_row) {
|
|||||||
|
|
||||||
ASSERT_EQ(1, constraintList.length);
|
ASSERT_EQ(1, constraintList.length);
|
||||||
|
|
||||||
ASSERT_EQ(100, constraintList.constraints[0].width);
|
ASSERT_FLOAT_EQ(100, constraintList.constraints[0].width);
|
||||||
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].widthMode);
|
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].widthMode);
|
||||||
|
|
||||||
free(constraintList.constraints);
|
free(constraintList.constraints);
|
||||||
@@ -196,7 +196,7 @@ TEST(CSSLayoutTest, at_most_cross_axis_row) {
|
|||||||
|
|
||||||
ASSERT_EQ(1, constraintList.length);
|
ASSERT_EQ(1, constraintList.length);
|
||||||
|
|
||||||
ASSERT_EQ(100, constraintList.constraints[0].height);
|
ASSERT_FLOAT_EQ(100, constraintList.constraints[0].height);
|
||||||
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].heightMode);
|
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].heightMode);
|
||||||
|
|
||||||
free(constraintList.constraints);
|
free(constraintList.constraints);
|
||||||
@@ -222,10 +222,10 @@ TEST(CSSLayoutTest, flex_child) {
|
|||||||
|
|
||||||
ASSERT_EQ(2, constraintList.length);
|
ASSERT_EQ(2, constraintList.length);
|
||||||
|
|
||||||
ASSERT_EQ(100, constraintList.constraints[0].height);
|
ASSERT_FLOAT_EQ(100, constraintList.constraints[0].height);
|
||||||
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].heightMode);
|
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].heightMode);
|
||||||
|
|
||||||
ASSERT_EQ(100, constraintList.constraints[1].height);
|
ASSERT_FLOAT_EQ(100, constraintList.constraints[1].height);
|
||||||
ASSERT_EQ(CSSMeasureModeExactly, constraintList.constraints[1].heightMode);
|
ASSERT_EQ(CSSMeasureModeExactly, constraintList.constraints[1].heightMode);
|
||||||
|
|
||||||
free(constraintList.constraints);
|
free(constraintList.constraints);
|
||||||
@@ -252,7 +252,7 @@ TEST(CSSLayoutTest, flex_child_with_flex_basis) {
|
|||||||
|
|
||||||
ASSERT_EQ(1, constraintList.length);
|
ASSERT_EQ(1, constraintList.length);
|
||||||
|
|
||||||
ASSERT_EQ(100, constraintList.constraints[0].height);
|
ASSERT_FLOAT_EQ(100, constraintList.constraints[0].height);
|
||||||
ASSERT_EQ(CSSMeasureModeExactly, constraintList.constraints[0].heightMode);
|
ASSERT_EQ(CSSMeasureModeExactly, constraintList.constraints[0].heightMode);
|
||||||
|
|
||||||
free(constraintList.constraints);
|
free(constraintList.constraints);
|
||||||
@@ -280,7 +280,7 @@ TEST(CSSLayoutTest, overflow_scroll_column) {
|
|||||||
|
|
||||||
ASSERT_EQ(1, constraintList.length);
|
ASSERT_EQ(1, constraintList.length);
|
||||||
|
|
||||||
ASSERT_EQ(100, constraintList.constraints[0].width);
|
ASSERT_FLOAT_EQ(100, constraintList.constraints[0].width);
|
||||||
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].widthMode);
|
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].widthMode);
|
||||||
|
|
||||||
ASSERT_TRUE(CSSValueIsUndefined(constraintList.constraints[0].height));
|
ASSERT_TRUE(CSSValueIsUndefined(constraintList.constraints[0].height));
|
||||||
@@ -315,7 +315,7 @@ TEST(CSSLayoutTest, overflow_scroll_row) {
|
|||||||
ASSERT_TRUE(CSSValueIsUndefined(constraintList.constraints[0].width));
|
ASSERT_TRUE(CSSValueIsUndefined(constraintList.constraints[0].width));
|
||||||
ASSERT_EQ(CSSMeasureModeUndefined, constraintList.constraints[0].widthMode);
|
ASSERT_EQ(CSSMeasureModeUndefined, constraintList.constraints[0].widthMode);
|
||||||
|
|
||||||
ASSERT_EQ(100, constraintList.constraints[0].height);
|
ASSERT_FLOAT_EQ(100, constraintList.constraints[0].height);
|
||||||
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].heightMode);
|
ASSERT_EQ(CSSMeasureModeAtMost, constraintList.constraints[0].heightMode);
|
||||||
|
|
||||||
free(constraintList.constraints);
|
free(constraintList.constraints);
|
||||||
|
@@ -70,27 +70,27 @@ TEST(CSSLayoutTest, max_width) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -107,27 +107,27 @@ TEST(CSSLayoutTest, max_height) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(90, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -147,37 +147,37 @@ TEST(CSSLayoutTest, min_height) {
|
|||||||
CSSNodeInsertChild(root, root_child1, 1);
|
CSSNodeInsertChild(root, root_child1, 1);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -198,37 +198,37 @@ TEST(CSSLayoutTest, min_width) {
|
|||||||
CSSNodeInsertChild(root, root_child1, 1);
|
CSSNodeInsertChild(root, root_child1, 1);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -246,27 +246,27 @@ TEST(CSSLayoutTest, justify_content_min_max) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -284,27 +284,27 @@ TEST(CSSLayoutTest, align_items_min_max) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(60, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(60, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -331,47 +331,47 @@ TEST(CSSLayoutTest, justify_content_overflow_min_max) {
|
|||||||
CSSNodeInsertChild(root, root_child2, 2);
|
CSSNodeInsertChild(root, root_child2, 2);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(110, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(110, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(-20, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(-20, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(110, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(110, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(-20, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(-20, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child1));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetTop(root_child1));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetTop(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child1));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child1));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child2));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetTop(root_child2));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetTop(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetWidth(root_child2));
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetHeight(root_child2));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetHeight(root_child2));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -392,37 +392,37 @@ TEST(CSSLayoutTest, flex_grow_within_max_width) {
|
|||||||
CSSNodeInsertChild(root_child0, root_child0_child0, 0);
|
CSSNodeInsertChild(root_child0, root_child0_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(200, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(200, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child0_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child0_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(200, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(200, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root_child0_child0));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root_child0_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child0_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child0_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -443,37 +443,37 @@ TEST(CSSLayoutTest, flex_grow_within_constrained_max_width) {
|
|||||||
CSSNodeInsertChild(root_child0, root_child0_child0, 0);
|
CSSNodeInsertChild(root_child0, root_child0_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(200, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(200, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(200, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(200, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
||||||
ASSERT_EQ(200, CSSNodeLayoutGetWidth(root_child0_child0));
|
ASSERT_FLOAT_EQ(200, CSSNodeLayoutGetWidth(root_child0_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child0_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child0_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(200, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(200, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(200, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(200, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root_child0_child0));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root_child0_child0));
|
||||||
ASSERT_EQ(200, CSSNodeLayoutGetWidth(root_child0_child0));
|
ASSERT_FLOAT_EQ(200, CSSNodeLayoutGetWidth(root_child0_child0));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child0_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child0_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -42,17 +42,17 @@ TEST(CSSLayoutTest, padding_no_size) {
|
|||||||
CSSNodeStyleSetPadding(root, CSSEdgeBottom, 10);
|
CSSNodeStyleSetPadding(root, CSSEdgeBottom, 10);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -70,27 +70,27 @@ TEST(CSSLayoutTest, padding_container_match_child) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(30, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(30, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -110,27 +110,27 @@ TEST(CSSLayoutTest, padding_flex_child) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -149,27 +149,27 @@ TEST(CSSLayoutTest, padding_stretch_child) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(80, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
@@ -190,27 +190,27 @@ TEST(CSSLayoutTest, padding_center_child) {
|
|||||||
CSSNodeInsertChild(root, root_child0, 0);
|
CSSNodeInsertChild(root, root_child0, 0);
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(40, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(40, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(35, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(35, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionRTL);
|
||||||
|
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetLeft(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetLeft(root));
|
||||||
ASSERT_EQ(0, CSSNodeLayoutGetTop(root));
|
ASSERT_FLOAT_EQ(0, CSSNodeLayoutGetTop(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetWidth(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetWidth(root));
|
||||||
ASSERT_EQ(100, CSSNodeLayoutGetHeight(root));
|
ASSERT_FLOAT_EQ(100, CSSNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
ASSERT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
ASSERT_FLOAT_EQ(50, CSSNodeLayoutGetLeft(root_child0));
|
||||||
ASSERT_EQ(35, CSSNodeLayoutGetTop(root_child0));
|
ASSERT_FLOAT_EQ(35, CSSNodeLayoutGetTop(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetWidth(root_child0));
|
||||||
ASSERT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(10, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,7 @@ TEST(CSSLayoutTest, dont_cache_computed_flex_basis_between_layouts) {
|
|||||||
CSSNodeCalculateLayout(root, 100, CSSUndefined, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, 100, CSSUndefined, CSSDirectionLTR);
|
||||||
CSSNodeCalculateLayout(root, 100, 100, CSSDirectionLTR);
|
CSSNodeCalculateLayout(root, 100, 100, CSSDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(20, CSSNodeLayoutGetHeight(root_child0));
|
ASSERT_FLOAT_EQ(20, CSSNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
CSSNodeFreeRecursive(root);
|
CSSNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,7 @@ TEST(CSSLayoutTest, copy_style_modified) {
|
|||||||
CSSNodeCopyStyle(node0, node1);
|
CSSNodeCopyStyle(node0, node1);
|
||||||
ASSERT_TRUE(CSSNodeIsDirty(node0));
|
ASSERT_TRUE(CSSNodeIsDirty(node0));
|
||||||
ASSERT_EQ(CSSFlexDirectionRow, CSSNodeStyleGetFlexDirection(node0));
|
ASSERT_EQ(CSSFlexDirectionRow, CSSNodeStyleGetFlexDirection(node0));
|
||||||
ASSERT_EQ(10, CSSNodeStyleGetMaxHeight(node0));
|
ASSERT_FLOAT_EQ(10, CSSNodeStyleGetMaxHeight(node0));
|
||||||
|
|
||||||
CSSNodeFree(node0);
|
CSSNodeFree(node0);
|
||||||
CSSNodeFree(node1);
|
CSSNodeFree(node1);
|
||||||
|
Reference in New Issue
Block a user