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(
ScoreCalibrationCalculatorTest, CalibrationWithoutIndicesTest,
Values(CalibrationTestParams{.score_transformation = "IDENTITY",
.expected_results = {0.4948505976,
0.5059588508, 0.2, 0.2}},
Values(CalibrationTestParams{
/* score_transformation= */ "IDENTITY",
/* expected_results= */ {0.4948505976, 0.5059588508, 0.2, 0.2}},
CalibrationTestParams{
.score_transformation = "LOG",
.expected_results = {0.2976901255, 0.3393665735, 0.2, 0.2}},
/* score_transformation= */ "LOG",
/* expected_results= */ {0.2976901255, 0.3393665735, 0.2, 0.2}},
CalibrationTestParams{
.score_transformation = "INVERSE_LOGISTIC",
.expected_results = {0.3203217641, 0.3778080605, 0.2, 0.2}}),
/* score_transformation= */ "INVERSE_LOGISTIC",
/* expected_results= */ {0.3203217641, 0.3778080605, 0.2, 0.2}}),
[](const TestParamInfo<CalibrationWithoutIndicesTest::ParamType>& info) {
return info.param.score_transformation;
});

View File

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