Fixup UTs for MSVC and Release Mode

Summary: This fixes incompatibility with MSVC in /W3 (designated initializers, precision loss) along with guarding tests which will only pass in DEBUG builds

Reviewed By: cortinico

Differential Revision: D42406531

fbshipit-source-id: 2c0d59678f76decf9b9b4d91a7c9ec12136ca1b9
This commit is contained in:
Nick Gerleman
2023-01-09 13:59:19 -08:00
committed by Facebook GitHub Bot
parent 9808358e08
commit 83cef5b12f
11 changed files with 55 additions and 70 deletions

View File

@@ -19,8 +19,8 @@ static YGSize _measureMax(
(*measureCount)++;
return YGSize{
.width = widthMode == YGMeasureModeUndefined ? 10 : width,
.height = heightMode == YGMeasureModeUndefined ? 10 : height,
widthMode == YGMeasureModeUndefined ? 10 : width,
heightMode == YGMeasureModeUndefined ? 10 : height,
};
}
@@ -33,11 +33,11 @@ static YGSize _measureMin(
int* measureCount = (int*) node->getContext();
*measureCount = *measureCount + 1;
return YGSize{
.width = widthMode == YGMeasureModeUndefined ||
widthMode == YGMeasureModeUndefined ||
(widthMode == YGMeasureModeAtMost && width > 10)
? 10
: width,
.height = heightMode == YGMeasureModeUndefined ||
heightMode == YGMeasureModeUndefined ||
(heightMode == YGMeasureModeAtMost && height > 10)
? 10
: height,
@@ -55,10 +55,7 @@ static YGSize _measure_84_49(
(*measureCount)++;
}
return YGSize{
.width = 84.f,
.height = 49.f,
};
return YGSize{84.f, 49.f};
}
TEST(YogaTest, measure_once_single_flexible_child) {