@@ -56,99 +56,95 @@ namespace {
5656using namespace ::viam::sdk;
5757using namespace ::viam::sdktests;
5858
59- const struct MLModelService ::metadata test_metadata {
59+ const struct MLModelService ::metadata test_metadata{
6060 // `name`
6161 " my model" ,
6262
63- // `type`
64- " magic" ,
63+ // `type`
64+ " magic" ,
6565
66- // `description`,
67- " Convolutional neural network ..." ,
66+ // `description`,
67+ " Convolutional neural network ..." ,
6868
69- // `inputs`
70- {{
69+ // `inputs`
70+ {{
7171
72- // `name`
73- " input1" ,
72+ // `name`
73+ " input1" ,
7474
75- // `description`
76- " the first input" ,
75+ // `description`
76+ " the first input" ,
7777
78- // `data_type`
79- MLModelService::tensor_info::data_types::k_float32,
78+ // `data_type`
79+ MLModelService::tensor_info::data_types::k_float32,
8080
81- // `shape`
82- {640 , 480 , -1 },
81+ // `shape`
82+ {640 , 480 , -1 },
8383
84- // `associated_files`
85- {{// `name`
86- " path/to/file1.1" ,
84+ // `associated_files`
85+ {{// `name`
86+ " path/to/file1.1" ,
8787
88- // `description`
89- " i1f1" ,
88+ // `description`
89+ " i1f1" ,
9090
91- // `label_type`
92- MLModelService::tensor_info::file::k_label_type_tensor_value},
93- {" path/to/file1.2" ,
94- " i1f2" ,
95- MLModelService::tensor_info::file::k_label_type_tensor_axis}},
91+ // `label_type`
92+ MLModelService::tensor_info::file::k_label_type_tensor_value},
93+ {" path/to/file1.2" , " i1f2" , MLModelService::tensor_info::file::k_label_type_tensor_axis}},
9694
97- // `extra`
98- ProtoStruct{{" foo" , ProtoValue{" bar" }}}},
95+ // `extra`
96+ ProtoStruct{{" foo" , ProtoValue{" bar" }}}},
9997
100- {" input2" ,
101- " the second input" ,
102- MLModelService::tensor_info::data_types::k_int32,
103- {4096 , 2160 , 3 , -1 },
104- {{" path/to/file2.1" , " i2f1" , MLModelService::tensor_info::file::k_label_type_tensor_axis},
105- {" path/to/file2.2" ,
106- " i2f2" ,
107- MLModelService::tensor_info::file::k_label_type_tensor_value}},
108- ProtoStruct{{" bar" , ProtoValue{false }}}}},
98+ {" input2" ,
99+ " the second input" ,
100+ MLModelService::tensor_info::data_types::k_int32,
101+ {4096 , 2160 , 3 , -1 },
102+ {{" path/to/file2.1" , " i2f1" , MLModelService::tensor_info::file::k_label_type_tensor_axis},
103+ {" path/to/file2.2" , " i2f2" , MLModelService::tensor_info::file::k_label_type_tensor_value}},
104+ ProtoStruct{{" bar" , ProtoValue{false }}}}},
109105
110- // `outputs`
111- {{
106+ // `outputs`
107+ {{
112108
113- // `name`
114- " output1" ,
109+ // `name`
110+ " output1" ,
115111
116- // `description`
117- " the first output" ,
112+ // `description`
113+ " the first output" ,
118114
119- // `data_type`
120- MLModelService::tensor_info::data_types::k_int32,
115+ // `data_type`
116+ MLModelService::tensor_info::data_types::k_int32,
121117
122- // `shape`
123- {-1 , -1 },
118+ // `shape`
119+ {-1 , -1 },
124120
125- // `associated_files`
126- {{// `name`
127- " path/to/output_file1.1" ,
121+ // `associated_files`
122+ {{// `name`
123+ " path/to/output_file1.1" ,
128124
129- // `description`
130- " o1f1" ,
125+ // `description`
126+ " o1f1" ,
131127
132- // `label_type`
133- MLModelService::tensor_info::file::k_label_type_tensor_axis},
134- {" path/to/output_file1.2" ,
135- " o1f2" ,
136- MLModelService::tensor_info::file::k_label_type_tensor_value}},
128+ // `label_type`
129+ MLModelService::tensor_info::file::k_label_type_tensor_axis},
130+ {" path/to/output_file1.2" ,
131+ " o1f2" ,
132+ MLModelService::tensor_info::file::k_label_type_tensor_value}},
137133
138- // `extra`
139- ProtoStruct{{" baz" , ProtoValue{}}}},
134+ // `extra`
135+ ProtoStruct{{" baz" , ProtoValue{}}}},
140136
141- {" output2" ,
142- " the second output" ,
143- MLModelService::tensor_info::data_types::k_float32,
144- {-1 , -1 , 4 },
145- {{" path/to/output_file2.1" ,
146- " o2f1" ,
147- MLModelService::tensor_info::file::k_label_type_tensor_axis},
148- {" path/to/output_file2.2" ,
149- " o2f2" ,
150- MLModelService::tensor_info::file::k_label_type_tensor_value}},
151- ProtoStruct{{" quux" , ProtoValue{3.14 }}}}},
137+ {" output2" ,
138+ " the second output" ,
139+ MLModelService::tensor_info::data_types::k_float32,
140+ {-1 , -1 , 4 },
141+ {{" path/to/output_file2.1" ,
142+ " o2f1" ,
143+ MLModelService::tensor_info::file::k_label_type_tensor_axis},
144+ {" path/to/output_file2.2" ,
145+ " o2f2" ,
146+ MLModelService::tensor_info::file::k_label_type_tensor_value}},
147+ ProtoStruct{{" quux" , ProtoValue{3.14 }}}}},
152148};
153149
154150BOOST_AUTO_TEST_SUITE (test_mock_mlmodel)
@@ -306,7 +302,6 @@ BOOST_AUTO_TEST_CASE(mock_infer_grpc_roundtrip) {
306302
307303BOOST_AUTO_TEST_SUITE_END ()
308304
309-
310305BOOST_AUTO_TEST_SUITE (test_mlmodel_bugfixes)
311306
312307BOOST_AUTO_TEST_CASE (RSDK_10768) {
@@ -316,13 +311,14 @@ BOOST_AUTO_TEST_CASE(RSDK_10768) {
316311 " bar" ,
317312 " baz" ,
318313 // `inputs`
319- {{" input" ,
320- " the input" ,
321- MLModelService::tensor_info::data_types::k_float32,
322- {1 },
323- {},
324- {}},
325- },
314+ {
315+ {" input" ,
316+ " the input" ,
317+ MLModelService::tensor_info::data_types::k_float32,
318+ {1 },
319+ {},
320+ {}},
321+ },
326322 // no `outputs`
327323 {}});
328324
0 commit comments