@@ -291,38 +291,40 @@ TEST(ComputationTestsGroup, computeSpecProp_test) {
291
291
pu[0 ].richness = 2 ;
292
292
pu[0 ].offset = 0 ;
293
293
pu[1 ].richness = 2 ;
294
- pu[1 ].offset = 1 ;
294
+ pu[1 ].offset = 2 ;
295
295
pu[2 ].richness = 2 ;
296
- pu[2 ].offset = 2 ;
297
-
298
- // Construct SM
299
- /*
300
- vector<map<int,spu>> SM(3);
301
- SM[0][0].amount = 100.0;
302
- SM[0][1].amount = 10.0;
303
- SM[1][0].amount = 50.0;
304
- SM[1][1].amount = 20.0;
305
- SM[2][0].amount = 5.0;
306
- SM[2][2].amount = 200.0;
307
- */
308
- // Temporal fix test compilaton
296
+ pu[2 ].offset = 4 ;
297
+
309
298
vector<spu> SM (6 );
299
+
310
300
SM[0 ].amount = 100.0 ;
301
+ SM[0 ].spindex = 0 ;
302
+
311
303
SM[1 ].amount = 10.0 ;
304
+ SM[1 ].spindex = 1 ;
305
+
306
+
312
307
SM[2 ].amount = 50.0 ;
308
+ SM[2 ].spindex = 0 ;
309
+
313
310
SM[3 ].amount = 20.0 ;
311
+ SM[3 ].spindex = 2 ;
312
+
314
313
SM[4 ].amount = 5.0 ;
314
+ SM[4 ].spindex = 1 ;
315
+
315
316
SM[5 ].amount = 200.0 ;
317
+ SM[5 ].spindex = 2 ;
316
318
317
319
computeSpecProp (3 , spec, 3 , pu, SM);
318
320
319
- CHECK_EQUAL (15.5 , spec[0 ].target );
320
- CHECK_EQUAL (15 , spec[1 ].target );
321
- CHECK_EQUAL (0 , spec[2 ].target );
321
+ CHECK_EQUAL (15 , spec[0 ].target );
322
+ CHECK_EQUAL (7.5 , spec[1 ].target );
323
+ CHECK_EQUAL (0.0 , spec[2 ].target );
322
324
}
323
325
324
326
// This function is a fixed value, we just need to check the 0 cases.
325
327
TEST (ComputationTestsGroup, computeSepPenalty_test_zero) {
326
328
CHECK_EQUAL (0.0 , computeSepPenalty (1 , 0 ));
327
- CHECK (computeSepPenalty (0 , 1 ) != 0 );
329
+ CHECK (computeSepPenalty (0 , 1 ) == 0. 0 );
328
330
}
0 commit comments