@@ -245,37 +245,53 @@ SCENARIO("MBT JSON Serialization", "[json]")
245
245
);
246
246
}
247
247
248
+ THEN (" VVS properties should be the same" )
249
+ {
250
+ vpMbGenericTracker t2 = baseTrackerConstructor ();
251
+ t2.setMaxIter (4096 );
252
+ t2.setLambda (5.0 );
253
+ t2.setInitialMu (5.0 );
254
+
255
+ t2.loadConfigFile (jsonPath);
256
+
257
+ checkProperties (t1, t2,
258
+ &vpMbGenericTracker::getMaxIter, " VVS m iterations be the same" ,
259
+ &vpMbGenericTracker::getLambda, " VVS lambda should be the same" ,
260
+ &vpMbGenericTracker::getInitialMu, " VVS initial mu be the same"
261
+ );
262
+ }
263
+
248
264
WHEN (" Modifying JSON file/Using a custom JSON file" )
249
265
{
250
266
THEN (" Removing version from file generates an error on load" )
251
267
{
252
268
modifyJson ([](json &j) -> void {
253
269
j.erase (" version" );
254
- });
270
+ });
255
271
REQUIRE_THROWS (t1.loadConfigFile (jsonPath));
256
272
}
257
273
258
274
THEN (" Using an unsupported version generates an error on load" )
259
275
{
260
276
modifyJson ([](json &j) -> void {
261
277
j[" version" ] = " 0.0.0" ;
262
- });
278
+ });
263
279
REQUIRE_THROWS (t1.loadConfigFile (jsonPath));
264
280
}
265
281
266
282
THEN (" Using an undefined reference camera generates an error" )
267
283
{
268
284
modifyJson ([](json &j) -> void {
269
285
j[" referenceCameraName" ] = " C3" ;
270
- });
286
+ });
271
287
REQUIRE_THROWS (t1.loadConfigFile (jsonPath));
272
288
}
273
289
274
290
THEN (" Not defining a transformation matrix for the reference camera is valid" )
275
291
{
276
292
modifyJson ([&t1](json &j) -> void {
277
293
j[" trackers" ][t1.getReferenceCameraName ()].erase (" camTref" );
278
- });
294
+ });
279
295
REQUIRE_NOTHROW (t1.loadConfigFile (jsonPath));
280
296
}
281
297
@@ -284,7 +300,7 @@ SCENARIO("MBT JSON Serialization", "[json]")
284
300
modifyJson ([&t1](json &j) -> void {
285
301
std::string otherCamName = t1.getReferenceCameraName () == " C1" ? " C2" : " C1" ;
286
302
j[" trackers" ][otherCamName].erase (" camTref" );
287
- });
303
+ });
288
304
REQUIRE_THROWS (t1.loadConfigFile (jsonPath));
289
305
}
290
306
@@ -301,7 +317,7 @@ SCENARIO("MBT JSON Serialization", "[json]")
301
317
for (const auto &c : t1.getCameraNames ()) {
302
318
j[" trackers" ][c].erase (" clipping" );
303
319
}
304
- });
320
+ });
305
321
REQUIRE_NOTHROW (t2.loadConfigFile (jsonPath, false ));
306
322
REQUIRE (t2.getClipping () == clipping);
307
323
REQUIRE (t2.getNearClippingDistance () == clipping_near);
@@ -323,7 +339,7 @@ SCENARIO("MBT JSON Serialization", "[json]")
323
339
for (const auto &c : t1.getCameraNames ()) {
324
340
j[" trackers" ][c][" clipping" ].erase (" near" );
325
341
}
326
- });
342
+ });
327
343
t2.loadConfigFile (jsonPath);
328
344
REQUIRE (t2.getNearClippingDistance () == clipping_near);
329
345
REQUIRE (t2.getFarClippingDistance () == t1.getFarClippingDistance ());
@@ -335,7 +351,7 @@ SCENARIO("MBT JSON Serialization", "[json]")
335
351
for (const auto &c : t1.getCameraNames ()) {
336
352
j[" trackers" ][c][" clipping" ].erase (" far" );
337
353
}
338
- });
354
+ });
339
355
t2.loadConfigFile (jsonPath);
340
356
REQUIRE (t2.getNearClippingDistance () == t1.getNearClippingDistance ());
341
357
REQUIRE (t2.getFarClippingDistance () == clipping_far);
@@ -347,7 +363,7 @@ SCENARIO("MBT JSON Serialization", "[json]")
347
363
for (const auto &c : t1.getCameraNames ()) {
348
364
j[" trackers" ][c][" clipping" ].erase (" flags" );
349
365
}
350
- });
366
+ });
351
367
t2.loadConfigFile (jsonPath);
352
368
REQUIRE (t2.getNearClippingDistance () == t1.getNearClippingDistance ());
353
369
REQUIRE (t2.getFarClippingDistance () == t1.getFarClippingDistance ());
@@ -358,7 +374,7 @@ SCENARIO("MBT JSON Serialization", "[json]")
358
374
}
359
375
}
360
376
}
361
- int main (int argc, char *argv [])
377
+ int main (int argc, char *argv[])
362
378
{
363
379
Catch::Session session; // There must be exactly one instance
364
380
session.applyCommandLine (argc, argv);
0 commit comments