diff --git a/tests/EventsTest.cpp b/tests/EventsTest.cpp index cf887b2d..108e3377 100644 --- a/tests/EventsTest.cpp +++ b/tests/EventsTest.cpp @@ -251,7 +251,7 @@ TEST_F(EventTest, layout_events_has_max_measure_cache) { TEST_F(EventTest, measure_functions_get_wrapped) { auto root = YGNodeNew(); YGNodeSetMeasureFunc( - root, [](YGNodeRef, float, YGMeasureMode, float, YGMeasureMode) { + root, [](YGNodeRef, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode) { return YGSize{}; }); @@ -269,7 +269,7 @@ TEST_F(EventTest, baseline_functions_get_wrapped) { auto child = YGNodeNew(); YGNodeInsertChild(root, child, 0); - YGNodeSetBaselineFunc(child, [](YGNodeRef, float, float) { return 0.0f; }); + YGNodeSetBaselineFunc(child, [](YGNodeRef, YGFloat, YGFloat) { return 0.0; }); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetAlignItems(root, YGAlignBaseline); diff --git a/tests/YGAlignBaselineTest.cpp b/tests/YGAlignBaselineTest.cpp index 35abfe76..2f7903c5 100644 --- a/tests/YGAlignBaselineTest.cpp +++ b/tests/YGAlignBaselineTest.cpp @@ -9,18 +9,18 @@ #include #include -static float _baselineFunc( +static YGFloat _baselineFunc( YGNodeRef node, - const float width, - const float height) { + const YGFloat width, + const YGFloat height) { return height / 2; } static YGSize _measure1( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ .width = 42, @@ -30,9 +30,9 @@ static YGSize _measure1( static YGSize _measure2( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ .width = 279, diff --git a/tests/YGAspectRatioTest.cpp b/tests/YGAspectRatioTest.cpp index a1c31ecd..91d2ba7e 100644 --- a/tests/YGAspectRatioTest.cpp +++ b/tests/YGAspectRatioTest.cpp @@ -11,9 +11,9 @@ static YGSize _measure( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ .width = widthMode == YGMeasureModeExactly ? width : 50, diff --git a/tests/YGBaselineFuncTest.cpp b/tests/YGBaselineFuncTest.cpp index eb15185e..64c01359 100644 --- a/tests/YGBaselineFuncTest.cpp +++ b/tests/YGBaselineFuncTest.cpp @@ -9,8 +9,8 @@ #include #include -static float _baseline(YGNodeRef node, const float width, const float height) { - float* baseline = (float*) node->getContext(); +static YGFloat _baseline(YGNodeRef node, const YGFloat width, const YGFloat height) { + YGFloat* baseline = (YGFloat*) node->getContext(); return *baseline; } @@ -31,7 +31,7 @@ TEST(YogaTest, align_baseline_customer_func) { YGNodeStyleSetHeight(root_child1, 20); YGNodeInsertChild(root, root_child1, 1); - float baselineValue = 10; + YGFloat baselineValue = 10; const YGNodeRef root_child1_child0 = YGNodeNew(); root_child1_child0->setContext(&baselineValue); YGNodeStyleSetWidth(root_child1_child0, 50); diff --git a/tests/YGMeasureCacheTest.cpp b/tests/YGMeasureCacheTest.cpp index 60ad6f47..9efc78b1 100644 --- a/tests/YGMeasureCacheTest.cpp +++ b/tests/YGMeasureCacheTest.cpp @@ -11,9 +11,9 @@ static YGSize _measureMax( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { int* measureCount = (int*) node->getContext(); (*measureCount)++; @@ -26,9 +26,9 @@ static YGSize _measureMax( static YGSize _measureMin( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { int* measureCount = (int*) node->getContext(); *measureCount = *measureCount + 1; @@ -46,9 +46,9 @@ static YGSize _measureMin( static YGSize _measure_84_49( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { int* measureCount = (int*) node->getContext(); if (measureCount) { diff --git a/tests/YGMeasureModeTest.cpp b/tests/YGMeasureModeTest.cpp index 6ed7b2c0..6a12b1c2 100644 --- a/tests/YGMeasureModeTest.cpp +++ b/tests/YGMeasureModeTest.cpp @@ -10,9 +10,9 @@ #include struct _MeasureConstraint { - float width; + YGFloat width; YGMeasureMode widthMode; - float height; + YGFloat height; YGMeasureMode heightMode; }; @@ -23,9 +23,9 @@ struct _MeasureConstraintList { static YGSize _measure( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { struct _MeasureConstraintList* constraintList = (struct _MeasureConstraintList*) node->getContext(); diff --git a/tests/YGMeasureTest.cpp b/tests/YGMeasureTest.cpp index e47607d4..a375305a 100644 --- a/tests/YGMeasureTest.cpp +++ b/tests/YGMeasureTest.cpp @@ -11,9 +11,9 @@ static YGSize _measure( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { int* measureCount = (int*) node->getContext(); if (measureCount) { @@ -28,9 +28,9 @@ static YGSize _measure( static YGSize _simulate_wrapping_text( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { if (widthMode == YGMeasureModeUndefined || width >= 68) { return YGSize{.width = 68, .height = 16}; @@ -44,9 +44,9 @@ static YGSize _simulate_wrapping_text( static YGSize _measure_assert_negative( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { EXPECT_GE(width, 0); EXPECT_GE(height, 0); @@ -643,9 +643,9 @@ TEST(YogaTest, cant_call_negative_measure_horizontal) { static YGSize _measure_90_10( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ @@ -656,9 +656,9 @@ static YGSize _measure_90_10( static YGSize _measure_100_100( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ diff --git a/tests/YGMinMaxDimensionTest.cpp b/tests/YGMinMaxDimensionTest.cpp index 621aff4d..2090cfff 100644 --- a/tests/YGMinMaxDimensionTest.cpp +++ b/tests/YGMinMaxDimensionTest.cpp @@ -1298,9 +1298,9 @@ TEST(YogaTest, min_max_percent_no_width_height) { static YGSize _measureCk_test_label_shrink_based_on_height( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { if (heightMode == YGMeasureModeAtMost) { diff --git a/tests/YGNodeCallbackTest.cpp b/tests/YGNodeCallbackTest.cpp index 5e765a0d..b609fd60 100644 --- a/tests/YGNodeCallbackTest.cpp +++ b/tests/YGNodeCallbackTest.cpp @@ -22,7 +22,7 @@ TEST(YGNode, hasMeasureFunc_initial) { TEST(YGNode, hasMeasureFunc_with_measure_fn) { auto n = YGNode{}; - n.setMeasureFunc([](YGNode*, float, YGMeasureMode, float, YGMeasureMode) { + n.setMeasureFunc([](YGNode*, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode) { return YGSize{}; }); ASSERT_TRUE(n.hasMeasureFunc()); @@ -32,7 +32,7 @@ TEST(YGNode, measure_with_measure_fn) { auto n = YGNode{}; n.setMeasureFunc( - [](YGNode*, float w, YGMeasureMode wm, float h, YGMeasureMode hm) { + [](YGNode*, YGFloat w, YGMeasureMode wm, YGFloat h, YGMeasureMode hm) { return YGSize{w * wm, h / hm}; }); @@ -44,7 +44,7 @@ TEST(YGNode, measure_with_measure_fn) { TEST(YGNode, measure_with_context_measure_fn) { auto n = YGNode{}; n.setMeasureFunc( - [](YGNode*, float, YGMeasureMode, float, YGMeasureMode, void* ctx) { + [](YGNode*, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode, void* ctx) { return *(YGSize*) ctx; }); @@ -57,11 +57,11 @@ TEST(YGNode, measure_with_context_measure_fn) { TEST(YGNode, switching_measure_fn_types) { auto n = YGNode{}; n.setMeasureFunc( - [](YGNode*, float, YGMeasureMode, float, YGMeasureMode, void*) { + [](YGNode*, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode, void*) { return YGSize{}; }); n.setMeasureFunc( - [](YGNode*, float w, YGMeasureMode wm, float h, YGMeasureMode hm) { + [](YGNode*, YGFloat w, YGMeasureMode wm, YGFloat h, YGMeasureMode hm) { return YGSize{w * wm, h / hm}; }); @@ -72,7 +72,7 @@ TEST(YGNode, switching_measure_fn_types) { TEST(YGNode, hasMeasureFunc_after_unset) { auto n = YGNode{}; - n.setMeasureFunc([](YGNode*, float, YGMeasureMode, float, YGMeasureMode) { + n.setMeasureFunc([](YGNode*, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode) { return YGSize{}; }); @@ -83,7 +83,7 @@ TEST(YGNode, hasMeasureFunc_after_unset) { TEST(YGNode, hasMeasureFunc_after_unset_context) { auto n = YGNode{}; n.setMeasureFunc( - [](YGNode*, float, YGMeasureMode, float, YGMeasureMode, void*) { + [](YGNode*, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode, void*) { return YGSize{}; }); @@ -98,20 +98,20 @@ TEST(YGNode, hasBaselineFunc_initial) { TEST(YGNode, hasBaselineFunc_with_baseline_fn) { auto n = YGNode{}; - n.setBaselineFunc([](YGNode*, float, float) { return 0.0f; }); + n.setBaselineFunc([](YGNode*, YGFloat, YGFloat) { return 0.0; }); ASSERT_TRUE(n.hasBaselineFunc()); } TEST(YGNode, baseline_with_baseline_fn) { auto n = YGNode{}; - n.setBaselineFunc([](YGNode*, float w, float h) { return w + h; }); + n.setBaselineFunc([](YGNode*, YGFloat w, YGFloat h) { return w + h; }); ASSERT_EQ(n.baseline(1.25f, 2.5f, nullptr), 3.75f); } TEST(YGNode, baseline_with_context_baseline_fn) { auto n = YGNode{}; - n.setBaselineFunc([](YGNode*, float w, float h, void* ctx) { + n.setBaselineFunc([](YGNode*, YGFloat w, YGFloat h, void* ctx) { return w + h + *(float*) ctx; }); @@ -121,7 +121,7 @@ TEST(YGNode, baseline_with_context_baseline_fn) { TEST(YGNode, hasBaselineFunc_after_unset) { auto n = YGNode{}; - n.setBaselineFunc([](YGNode*, float, float) { return 0.0f; }); + n.setBaselineFunc([](YGNode*, YGFloat, YGFloat) { return 0.0; }); n.setBaselineFunc(nullptr); ASSERT_FALSE(n.hasBaselineFunc()); @@ -129,7 +129,7 @@ TEST(YGNode, hasBaselineFunc_after_unset) { TEST(YGNode, hasBaselineFunc_after_unset_context) { auto n = YGNode{}; - n.setBaselineFunc([](YGNode*, float, float, void*) { return 0.0f; }); + n.setBaselineFunc([](YGNode*, YGFloat, YGFloat, void*) { return 0.0; }); n.setMeasureFunc(nullptr); ASSERT_FALSE(n.hasMeasureFunc()); @@ -137,8 +137,8 @@ TEST(YGNode, hasBaselineFunc_after_unset_context) { TEST(YGNode, switching_baseline_fn_types) { auto n = YGNode{}; - n.setBaselineFunc([](YGNode*, float, float, void*) { return 0.0f; }); - n.setBaselineFunc([](YGNode*, float, float) { return 1.0f; }); + n.setBaselineFunc([](YGNode*, YGFloat, YGFloat, void*) { return 0.0; }); + n.setBaselineFunc([](YGNode*, YGFloat, YGFloat) { return 1.0; }); ASSERT_EQ(n.baseline(1, 2, nullptr), 1.0f); } diff --git a/tests/YGPercentageTest.cpp b/tests/YGPercentageTest.cpp index 805df24b..276e2299 100644 --- a/tests/YGPercentageTest.cpp +++ b/tests/YGPercentageTest.cpp @@ -1196,9 +1196,9 @@ TEST(YogaTest, percent_absolute_position) { static YGSize _measureCk_test_label_shrink_based_on_height( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { if (heightMode == YGMeasureModeAtMost) { diff --git a/tests/YGRoundingFunctionTest.cpp b/tests/YGRoundingFunctionTest.cpp index 21daeac6..91e4aa5c 100644 --- a/tests/YGRoundingFunctionTest.cpp +++ b/tests/YGRoundingFunctionTest.cpp @@ -44,9 +44,9 @@ TEST(YogaTest, rounding_value) { static YGSize measureText( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return (YGSize){.width = 10, .height = 10}; } diff --git a/tests/YGRoundingMeasureFuncTest.cpp b/tests/YGRoundingMeasureFuncTest.cpp index 822e3701..3005f62a 100644 --- a/tests/YGRoundingMeasureFuncTest.cpp +++ b/tests/YGRoundingMeasureFuncTest.cpp @@ -11,9 +11,9 @@ static YGSize _measureFloor( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ width = 10.2f, @@ -23,9 +23,9 @@ static YGSize _measureFloor( static YGSize _measureCeil( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ width = 10.5f, @@ -35,9 +35,9 @@ static YGSize _measureCeil( static YGSize _measureFractial( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ width = 0.5f,