Do not use designated initializers

PiperOrigin-RevId: 513028900
This commit is contained in:
Sebastian Schmidt 2023-02-28 13:47:47 -08:00 committed by Copybara-Service
parent 172b360478
commit 4a1ba11e3f
2 changed files with 49 additions and 49 deletions

View File

@ -185,15 +185,15 @@ TEST_P(CalibrationWithoutIndicesTest, Succeeds) {
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P(
ScoreCalibrationCalculatorTest, CalibrationWithoutIndicesTest, ScoreCalibrationCalculatorTest, CalibrationWithoutIndicesTest,
Values(CalibrationTestParams{.score_transformation = "IDENTITY", Values(CalibrationTestParams{
.expected_results = {0.4948505976, /* score_transformation= */ "IDENTITY",
0.5059588508, 0.2, 0.2}}, /* expected_results= */ {0.4948505976, 0.5059588508, 0.2, 0.2}},
CalibrationTestParams{ CalibrationTestParams{
.score_transformation = "LOG", /* score_transformation= */ "LOG",
.expected_results = {0.2976901255, 0.3393665735, 0.2, 0.2}}, /* expected_results= */ {0.2976901255, 0.3393665735, 0.2, 0.2}},
CalibrationTestParams{ CalibrationTestParams{
.score_transformation = "INVERSE_LOGISTIC", /* score_transformation= */ "INVERSE_LOGISTIC",
.expected_results = {0.3203217641, 0.3778080605, 0.2, 0.2}}), /* expected_results= */ {0.3203217641, 0.3778080605, 0.2, 0.2}}),
[](const TestParamInfo<CalibrationWithoutIndicesTest::ParamType>& info) { [](const TestParamInfo<CalibrationWithoutIndicesTest::ParamType>& info) {
return info.param.score_transformation; return info.param.score_transformation;
}); });

View File

@ -117,24 +117,24 @@ TEST_P(Landmarks2dToMatrixCalculatorTest, OutputsCorrectResult) {
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P(
LandmarksToMatrixCalculatorTests, Landmarks2dToMatrixCalculatorTest, LandmarksToMatrixCalculatorTests, Landmarks2dToMatrixCalculatorTest,
testing::ValuesIn<Landmarks2dToMatrixCalculatorTestCase>( testing::ValuesIn<Landmarks2dToMatrixCalculatorTestCase>(
{{.test_name = "TestWithOffset0", {{/* test_name= */ "TestWithOffset0",
.base_offset = 0, /* base_offset= */ 0,
.object_normalization_origin_offset = 0, /* object_normalization_origin_offset= */ 0,
.expected_cell_0_2 = 0.1f, /* expected_cell_0_2= */ 0.1f,
.expected_cell_1_5 = 0.1875f, /* expected_cell_1_5= */ 0.1875f,
.rotation = 0}, /* rotation= */ 0},
{.test_name = "TestWithOffset21", {/* test_name= */ "TestWithOffset21",
.base_offset = 21, /* base_offset= */ 21,
.object_normalization_origin_offset = 0, /* object_normalization_origin_offset= */ 0,
.expected_cell_0_2 = 0.1f, /* expected_cell_0_2= */ 0.1f,
.expected_cell_1_5 = 0.1875f, /* expected_cell_1_5= */ 0.1875f,
.rotation = 0}, /* rotation= */ 0},
{.test_name = "TestWithRotation", {/* test_name= */ "TestWithRotation",
.base_offset = 0, /* base_offset= */ 0,
.object_normalization_origin_offset = 0, /* object_normalization_origin_offset= */ 0,
.expected_cell_0_2 = 0.075f, /* expected_cell_0_2= */ 0.075f,
.expected_cell_1_5 = -0.25f, /* expected_cell_1_5= */ -0.25f,
.rotation = M_PI / 2.0}}), /* rotation= */ M_PI / 2.0}}),
[](const testing::TestParamInfo< [](const testing::TestParamInfo<
Landmarks2dToMatrixCalculatorTest::ParamType>& info) { Landmarks2dToMatrixCalculatorTest::ParamType>& info) {
return info.param.test_name; return info.param.test_name;
@ -203,30 +203,30 @@ TEST_P(LandmarksWorld3dToMatrixCalculatorTest, OutputsCorrectResult) {
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P(
LandmarksToMatrixCalculatorTests, LandmarksWorld3dToMatrixCalculatorTest, LandmarksToMatrixCalculatorTests, LandmarksWorld3dToMatrixCalculatorTest,
testing::ValuesIn<LandmarksWorld3dToMatrixCalculatorTestCase>( testing::ValuesIn<LandmarksWorld3dToMatrixCalculatorTestCase>(
{{.test_name = "TestWithOffset0", {{/* test_name= */ "TestWithOffset0",
.base_offset = 0, /* base_offset= */ 0,
.object_normalization_origin_offset = 0, /* object_normalization_origin_offset= */ 0,
.expected_cell_0_2 = 0.1f, /* expected_cell_0_2= */ 0.1f,
.expected_cell_1_5 = 0.25, /* expected_cell_1_5= */ 0.25,
.rotation = 0}, /* rotation= */ 0},
{.test_name = "TestWithOffset21", {/* test_name= */ "TestWithOffset21",
.base_offset = 21, /* base_offset= */ 21,
.object_normalization_origin_offset = 0, /* object_normalization_origin_offset= */ 0,
.expected_cell_0_2 = 0.1f, /* expected_cell_0_2= */ 0.1f,
.expected_cell_1_5 = 0.25, /* expected_cell_1_5= */ 0.25,
.rotation = 0}, /* rotation= */ 0},
{.test_name = "NoObjectNormalization", {/* test_name= */ "NoObjectNormalization",
.base_offset = 0, /* base_offset= */ 0,
.object_normalization_origin_offset = -1, /* object_normalization_origin_offset= */ -1,
.expected_cell_0_2 = 0.021f, /* expected_cell_0_2= */ 0.021f,
.expected_cell_1_5 = 0.052f, /* expected_cell_1_5= */ 0.052f,
.rotation = 0}, /* rotation= */ 0},
{.test_name = "TestWithRotation", {/* test_name= */ "TestWithRotation",
.base_offset = 0, /* base_offset= */ 0,
.object_normalization_origin_offset = 0, /* object_normalization_origin_offset= */ 0,
.expected_cell_0_2 = 0.1f, /* expected_cell_0_2= */ 0.1f,
.expected_cell_1_5 = -0.25f, /* expected_cell_1_5= */ -0.25f,
.rotation = M_PI / 2.0}}), /* rotation= */ M_PI / 2.0}}),
[](const testing::TestParamInfo< [](const testing::TestParamInfo<
LandmarksWorld3dToMatrixCalculatorTest::ParamType>& info) { LandmarksWorld3dToMatrixCalculatorTest::ParamType>& info) {
return info.param.test_name; return info.param.test_name;