Line | Branch | Exec | Source |
---|---|---|---|
1 | // test configuration | ||
2 | |||
3 | #include <cassert> | ||
4 | #include <iguana/algorithms/Algorithm.h> | ||
5 | |||
6 | 3 | inline int TestConfig(int test_num, bool verbose) | |
7 | { | ||
8 |
1/2✗ Branch 0 (2→3) not taken.
✓ Branch 1 (2→5) taken 3 times.
|
3 | if(test_num == 0) { |
9 | ✗ | fmt::print(stderr, "ERROR: need a test number\n"); | |
10 | ✗ | return 1; | |
11 | } | ||
12 | // first, some sanity checks of `ConfigFileReader` | ||
13 | 3 | iguana::ConfigFileReader bad_config("bad_config"); | |
14 |
2/4✓ Branch 0 (6→7) taken 3 times.
✗ Branch 1 (6→1278) not taken.
✓ Branch 2 (7→8) taken 3 times.
✗ Branch 3 (7→683) not taken.
|
3 | bad_config.AddDirectory("non_existent_directory"); |
15 | try { | ||
16 |
2/4✓ Branch 0 (9→10) taken 3 times.
✗ Branch 1 (9→687) not taken.
✗ Branch 2 (10→11) not taken.
✓ Branch 3 (10→685) taken 3 times.
|
3 | bad_config.AddFile("non_existent_file.yaml"); |
17 | } | ||
18 |
1/2✗ Branch 0 (687→688) not taken.
✓ Branch 1 (687→689) taken 3 times.
|
3 | catch(std::exception const& ex) { |
19 | 3 | fmt::print("excpected exception thrown when trying to add non-existent file\n"); | |
20 | 3 | } | |
21 |
1/2✓ Branch 0 (13→14) taken 3 times.
✗ Branch 1 (13→1278) not taken.
|
3 | bad_config.PrintDirectories(); |
22 | |||
23 | // then test configuring an algorithm | ||
24 |
3/6✓ Branch 0 (14→15) taken 3 times.
✗ Branch 1 (14→1278) not taken.
✓ Branch 2 (15→16) taken 3 times.
✗ Branch 3 (15→694) not taken.
✗ Branch 4 (17→18) not taken.
✓ Branch 5 (17→19) taken 3 times.
|
6 | auto algo = iguana::AlgorithmFactory::Create("example::ExampleAlgorithm"); |
25 |
4/8✗ Branch 0 (17→18) not taken.
✓ Branch 1 (17→19) taken 3 times.
✓ Branch 2 (19→20) taken 3 times.
✗ Branch 3 (19→1274) not taken.
✓ Branch 4 (20→21) taken 3 times.
✗ Branch 5 (20→696) not taken.
✓ Branch 6 (22→23) taken 3 times.
✗ Branch 7 (22→1274) not taken.
|
6 | algo->SetOption("log", verbose ? "debug" : "info"); |
26 |
3/6✓ Branch 0 (22→23) taken 3 times.
✗ Branch 1 (22→1274) not taken.
✓ Branch 2 (23→24) taken 3 times.
✗ Branch 3 (23→698) not taken.
✓ Branch 4 (25→26) taken 3 times.
✗ Branch 5 (25→1274) not taken.
|
6 | algo->SetConfigDirectory("src/iguana/tests"); // must be relative to build directory |
27 |
2/4✓ Branch 0 (26→27) taken 3 times.
✗ Branch 1 (26→700) not taken.
✓ Branch 2 (28→29) taken 3 times.
✗ Branch 3 (28→1274) not taken.
|
6 | algo->SetConfigFile(fmt::format("test_{}.yaml", test_num)); |
28 |
1/2✓ Branch 0 (28→29) taken 3 times.
✗ Branch 1 (28→1274) not taken.
|
3 | algo->Start(); |
29 | |||
30 |
3/4✓ Branch 0 (29→30) taken 1 times.
✓ Branch 1 (29→178) taken 1 times.
✓ Branch 2 (29→308) taken 1 times.
✗ Branch 3 (29→676) not taken.
|
3 | switch(test_num) { |
31 | |||
32 | case 1: { | ||
33 | // test `GetOptionScalar` | ||
34 |
5/10✓ Branch 0 (30→31) taken 1 times.
✗ Branch 1 (30→1274) not taken.
✓ Branch 2 (32→33) taken 1 times.
✗ Branch 3 (32→704) not taken.
✓ Branch 4 (33→34) taken 1 times.
✗ Branch 5 (33→702) not taken.
✗ Branch 6 (34→35) not taken.
✓ Branch 7 (34→36) taken 1 times.
✓ Branch 8 (38→39) taken 1 times.
✗ Branch 9 (38→1274) not taken.
|
3 | assert((algo->GetOptionScalar<int>("scalar_int") == 1)); |
35 |
5/10✓ Branch 0 (38→39) taken 1 times.
✗ Branch 1 (38→1274) not taken.
✓ Branch 2 (40→41) taken 1 times.
✗ Branch 3 (40→708) not taken.
✓ Branch 4 (41→42) taken 1 times.
✗ Branch 5 (41→706) not taken.
✗ Branch 6 (42→43) not taken.
✓ Branch 7 (42→44) taken 1 times.
✓ Branch 8 (46→47) taken 1 times.
✗ Branch 9 (46→1274) not taken.
|
3 | assert((algo->GetOptionScalar<double>("scalar_double") == 2.5)); |
36 |
4/8✓ Branch 0 (46→47) taken 1 times.
✗ Branch 1 (46→1274) not taken.
✓ Branch 2 (48→49) taken 1 times.
✗ Branch 3 (48→712) not taken.
✓ Branch 4 (49→50) taken 1 times.
✗ Branch 5 (49→710) not taken.
✗ Branch 6 (50→51) not taken.
✓ Branch 7 (50→52) taken 1 times.
|
3 | assert((algo->GetOptionScalar<std::string>("scalar_string") == "lizard")); |
37 | // test `GetOptionVector` | ||
38 |
6/14✓ Branch 0 (55→56) taken 1 times.
✗ Branch 1 (55→1274) not taken.
✓ Branch 2 (56→57) taken 1 times.
✗ Branch 3 (56→718) not taken.
✓ Branch 4 (58→59) taken 1 times.
✗ Branch 5 (58→716) not taken.
✓ Branch 6 (59→60) taken 1 times.
✗ Branch 7 (59→714) not taken.
✗ Branch 8 (60→61) not taken.
✓ Branch 9 (60→62) taken 1 times.
✓ Branch 10 (67→68) taken 1 times.
✗ Branch 11 (67→70) not taken.
✗ Branch 12 (718→719) not taken.
✗ Branch 13 (718→721) not taken.
|
3 | assert((algo->GetOptionVector<int>("vector_int") == std::vector<int>{1, 2, 3})); |
39 |
6/14✓ Branch 0 (70→71) taken 1 times.
✗ Branch 1 (70→1274) not taken.
✓ Branch 2 (71→72) taken 1 times.
✗ Branch 3 (71→726) not taken.
✓ Branch 4 (73→74) taken 1 times.
✗ Branch 5 (73→724) not taken.
✓ Branch 6 (74→75) taken 1 times.
✗ Branch 7 (74→722) not taken.
✗ Branch 8 (79→80) not taken.
✓ Branch 9 (79→81) taken 1 times.
✓ Branch 10 (86→87) taken 1 times.
✗ Branch 11 (86→89) not taken.
✗ Branch 12 (726→727) not taken.
✗ Branch 13 (726→729) not taken.
|
4 | assert((algo->GetOptionVector<double>("vector_double") == std::vector<double>{1.5, 2.5})); |
40 |
11/22✓ Branch 0 (90→91) taken 4 times.
✗ Branch 1 (90→741) not taken.
✓ Branch 2 (92→90) taken 4 times.
✓ Branch 3 (92→93) taken 1 times.
✓ Branch 4 (93→94) taken 1 times.
✗ Branch 5 (93→736) not taken.
✓ Branch 6 (94→95) taken 1 times.
✗ Branch 7 (94→734) not taken.
✓ Branch 8 (96→97) taken 1 times.
✗ Branch 9 (96→732) not taken.
✓ Branch 10 (97→98) taken 1 times.
✗ Branch 11 (97→730) not taken.
✗ Branch 12 (98→99) not taken.
✓ Branch 13 (98→100) taken 1 times.
✓ Branch 14 (105→106) taken 4 times.
✓ Branch 15 (105→108) taken 1 times.
✓ Branch 16 (108→109) taken 1 times.
✗ Branch 17 (108→1274) not taken.
✗ Branch 18 (737→738) not taken.
✗ Branch 19 (737→740) not taken.
✗ Branch 20 (742→743) not taken.
✗ Branch 21 (742→745) not taken.
|
11 | assert((algo->GetOptionVector<std::string>("vector_string") == std::vector<std::string>{"spider", "bat", "chameleon", "spider"})); |
41 | // test `GetOptionSet` | ||
42 |
4/8✓ Branch 0 (108→109) taken 1 times.
✗ Branch 1 (108→1274) not taken.
✓ Branch 2 (110→111) taken 1 times.
✗ Branch 3 (110→748) not taken.
✓ Branch 4 (111→112) taken 1 times.
✗ Branch 5 (111→746) not taken.
✗ Branch 6 (114→115) not taken.
✓ Branch 7 (114→116) taken 1 times.
|
3 | auto s = algo->GetOptionSet<std::string>("vector_string"); |
43 |
1/2✗ Branch 0 (114→115) not taken.
✓ Branch 1 (114→116) taken 1 times.
|
1 | assert((s.size() == 3)); |
44 |
2/4✓ Branch 0 (116→117) taken 1 times.
✗ Branch 1 (116→823) not taken.
✗ Branch 2 (117→118) not taken.
✓ Branch 3 (117→119) taken 1 times.
|
1 | assert((s.find("spider") != s.end())); |
45 |
3/6✓ Branch 0 (120→121) taken 1 times.
✗ Branch 1 (120→823) not taken.
✗ Branch 2 (121→122) not taken.
✓ Branch 3 (121→123) taken 1 times.
✓ Branch 4 (124→125) taken 1 times.
✗ Branch 5 (124→754) not taken.
|
2 | assert((s.find("bee") == s.end())); |
46 | // test empty access - expect exceptions, so just catch them and do nothing | ||
47 | try { | ||
48 |
3/6✓ Branch 0 (124→125) taken 1 times.
✗ Branch 1 (124→754) not taken.
✓ Branch 2 (126→127) taken 1 times.
✗ Branch 3 (126→752) not taken.
✗ Branch 4 (127→128) not taken.
✓ Branch 5 (127→750) taken 1 times.
|
3 | algo->GetOptionScalar<int>("scalar_empty"); |
49 | ✗ | fmt::print(stderr, "ERROR: accessing 'scalar_empty' did not throw exception\n"); | |
50 | ✗ | return 1; | |
51 | } | ||
52 |
1/2✗ Branch 0 (754→755) not taken.
✓ Branch 1 (754→756) taken 1 times.
|
1 | catch(std::exception const& ex) { |
53 | 1 | fmt::print("SUCCESS: accessing 'scalar_empty' threw an expected exception\n"); | |
54 | 1 | } | |
55 | try { | ||
56 |
3/6✓ Branch 0 (133→134) taken 1 times.
✗ Branch 1 (133→764) not taken.
✗ Branch 2 (134→135) not taken.
✓ Branch 3 (134→762) taken 1 times.
✓ Branch 4 (759→132) taken 1 times.
✗ Branch 5 (759→766) not taken.
|
3 | algo->GetOptionVector<int>("vector_empty"); |
57 | ✗ | fmt::print(stderr, "ERROR: accessing 'vector_empty' did not throw exception\n"); | |
58 | ✗ | return 1; | |
59 | } | ||
60 |
1/2✗ Branch 0 (766→767) not taken.
✓ Branch 1 (766→768) taken 1 times.
|
1 | catch(std::exception const& ex) { |
61 | 1 | fmt::print("SUCCESS: accessing 'vector_empty' threw an expected exception\n"); | |
62 | 1 | } | |
63 | try { | ||
64 |
3/6✓ Branch 0 (143→144) taken 1 times.
✗ Branch 1 (143→776) not taken.
✗ Branch 2 (144→145) not taken.
✓ Branch 3 (144→774) taken 1 times.
✓ Branch 4 (771→142) taken 1 times.
✗ Branch 5 (771→778) not taken.
|
3 | algo->GetOptionSet<int>("vector_empty"); |
65 | ✗ | fmt::print(stderr, "ERROR: accessing 'vector_empty' as a `set` did not throw exception\n"); | |
66 | ✗ | return 1; | |
67 | } | ||
68 |
1/2✗ Branch 0 (778→779) not taken.
✓ Branch 1 (778→780) taken 1 times.
|
1 | catch(std::exception const& ex) { |
69 | 1 | fmt::print("SUCCESS: accessing 'vector_empty' as a `set` threw an expected exception\n"); | |
70 | 1 | } | |
71 | // test access to a key that does not exist | ||
72 | try { | ||
73 |
3/6✓ Branch 0 (151→152) taken 1 times.
✗ Branch 1 (151→788) not taken.
✗ Branch 2 (152→153) not taken.
✓ Branch 3 (152→786) taken 1 times.
✓ Branch 4 (783→150) taken 1 times.
✗ Branch 5 (783→790) not taken.
|
3 | algo->GetOptionScalar<int>("non_existent_scalar"); |
74 | ✗ | fmt::print(stderr, "ERROR: accessing 'non_existent_scalar' did not throw exception\n"); | |
75 | ✗ | return 1; | |
76 | } | ||
77 |
1/2✗ Branch 0 (790→791) not taken.
✓ Branch 1 (790→792) taken 1 times.
|
1 | catch(std::exception const& ex) { |
78 | 1 | fmt::print("SUCCESS: accessing 'non_existent_scalar' threw an expected exception\n"); | |
79 | 1 | } | |
80 | try { | ||
81 |
3/6✓ Branch 0 (158→159) taken 1 times.
✗ Branch 1 (158→800) not taken.
✗ Branch 2 (159→160) not taken.
✓ Branch 3 (159→798) taken 1 times.
✓ Branch 4 (795→157) taken 1 times.
✗ Branch 5 (795→802) not taken.
|
3 | algo->GetOptionVector<int>("non_existent_vector"); |
82 | ✗ | fmt::print(stderr, "ERROR: accessing 'non_existent_vector' did not throw exception\n"); | |
83 | ✗ | return 1; | |
84 | } | ||
85 |
1/2✗ Branch 0 (802→803) not taken.
✓ Branch 1 (802→804) taken 1 times.
|
1 | catch(std::exception const& ex) { |
86 | 1 | fmt::print("SUCCESS: accessing 'non_existent_vector' threw an expected exception\n"); | |
87 | 1 | } | |
88 | try { | ||
89 |
3/6✓ Branch 0 (168→169) taken 1 times.
✗ Branch 1 (168→812) not taken.
✗ Branch 2 (169→170) not taken.
✓ Branch 3 (169→810) taken 1 times.
✓ Branch 4 (807→167) taken 1 times.
✗ Branch 5 (807→814) not taken.
|
3 | algo->GetOptionSet<int>("non_existent_vector"); |
90 | ✗ | fmt::print(stderr, "ERROR: accessing 'non_existent_vector' as a `set` did not throw exception\n"); | |
91 | ✗ | return 1; | |
92 | } | ||
93 |
1/2✗ Branch 0 (814→815) not taken.
✓ Branch 1 (814→816) taken 1 times.
|
1 | catch(std::exception const& ex) { |
94 | 1 | fmt::print("SUCCESS: accessing 'non_existent_vector' as a `set` threw an expected exception\n"); | |
95 | 1 | } | |
96 | break; | ||
97 | } | ||
98 | |||
99 | case 2: { | ||
100 |
7/14✓ Branch 0 (180→181) taken 1 times.
✗ Branch 1 (180→829) not taken.
✓ Branch 2 (181→182) taken 1 times.
✗ Branch 3 (181→827) not taken.
✓ Branch 4 (182→183) taken 1 times.
✗ Branch 5 (182→825) not taken.
✗ Branch 6 (183→184) not taken.
✓ Branch 7 (183→185) taken 1 times.
✓ Branch 8 (188→189) taken 2 times.
✓ Branch 9 (188→191) taken 1 times.
✓ Branch 10 (191→192) taken 1 times.
✗ Branch 11 (191→848) not taken.
✗ Branch 12 (830→831) not taken.
✗ Branch 13 (830→833) not taken.
|
4 | assert((algo->GetOptionScalar<double>("t1s1", {"tree1", "scalar1"}) == 1.5)); |
101 |
7/14✓ Branch 0 (193→194) taken 1 times.
✗ Branch 1 (193→843) not taken.
✓ Branch 2 (194→195) taken 1 times.
✗ Branch 3 (194→841) not taken.
✓ Branch 4 (195→196) taken 1 times.
✗ Branch 5 (195→839) not taken.
✗ Branch 6 (196→197) not taken.
✓ Branch 7 (196→198) taken 1 times.
✓ Branch 8 (201→202) taken 2 times.
✓ Branch 9 (201→204) taken 1 times.
✓ Branch 10 (204→205) taken 1 times.
✗ Branch 11 (204→862) not taken.
✗ Branch 12 (844→845) not taken.
✗ Branch 13 (844→847) not taken.
|
4 | assert((algo->GetOptionScalar<double>("t1s2", {"tree1", "scalar2"}) == 2.5)); |
102 |
6/12✓ Branch 0 (207→208) taken 1 times.
✗ Branch 1 (207→857) not taken.
✓ Branch 2 (208→209) taken 1 times.
✗ Branch 3 (208→855) not taken.
✓ Branch 4 (209→210) taken 1 times.
✗ Branch 5 (209→853) not taken.
✗ Branch 6 (210→211) not taken.
✓ Branch 7 (210→212) taken 1 times.
✓ Branch 8 (215→216) taken 3 times.
✓ Branch 9 (215→218) taken 1 times.
✗ Branch 10 (858→859) not taken.
✗ Branch 11 (858→861) not taken.
|
5 | assert((algo->GetOptionScalar<double>("t2t1s1", {"tree2", "tree1", "scalar1"}) == 3.5)); |
103 |
12/24✓ Branch 0 (219→220) taken 2 times.
✗ Branch 1 (219→888) not taken.
✓ Branch 2 (221→219) taken 2 times.
✓ Branch 3 (221→222) taken 1 times.
✓ Branch 4 (222→223) taken 1 times.
✗ Branch 5 (222→883) not taken.
✓ Branch 6 (227→228) taken 1 times.
✗ Branch 7 (227→871) not taken.
✓ Branch 8 (228→229) taken 1 times.
✗ Branch 9 (228→869) not taken.
✓ Branch 10 (229→230) taken 1 times.
✗ Branch 11 (229→867) not taken.
✗ Branch 12 (230→231) not taken.
✓ Branch 13 (230→232) taken 1 times.
✓ Branch 14 (236→237) taken 4 times.
✓ Branch 15 (236→239) taken 1 times.
✓ Branch 16 (241→242) taken 2 times.
✓ Branch 17 (241→244) taken 1 times.
✗ Branch 18 (872→873) not taken.
✗ Branch 19 (872→875) not taken.
✗ Branch 20 (884→885) not taken.
✗ Branch 21 (884→887) not taken.
✗ Branch 22 (889→890) not taken.
✗ Branch 23 (889→892) not taken.
|
11 | assert((algo->GetOptionVector<std::string>("t2t2t3v1", {"tree2", "tree2", "tree3", "vector1"}) == std::vector<std::string>{"gecko", "snake"})); |
104 |
8/18✓ Branch 0 (244→245) taken 1 times.
✗ Branch 1 (244→1274) not taken.
✓ Branch 2 (247→248) taken 1 times.
✗ Branch 3 (247→897) not taken.
✓ Branch 4 (248→249) taken 1 times.
✗ Branch 5 (248→895) not taken.
✓ Branch 6 (249→250) taken 1 times.
✗ Branch 7 (249→893) not taken.
✗ Branch 8 (250→251) not taken.
✓ Branch 9 (250→252) taken 1 times.
✓ Branch 10 (258→259) taken 2 times.
✓ Branch 11 (258→261) taken 1 times.
✓ Branch 12 (261→262) taken 1 times.
✗ Branch 13 (261→264) not taken.
✗ Branch 14 (898→899) not taken.
✗ Branch 15 (898→901) not taken.
✗ Branch 16 (907→908) not taken.
✗ Branch 17 (907→910) not taken.
|
5 | assert((algo->GetOptionVector<int>("t2v2", {"tree2", "vector2"}) == std::vector<int>{3, -4, 5})); |
105 |
12/24✓ Branch 0 (265→266) taken 1 times.
✗ Branch 1 (265→927) not taken.
✓ Branch 2 (267→265) taken 1 times.
✓ Branch 3 (267→268) taken 1 times.
✓ Branch 4 (268→269) taken 1 times.
✗ Branch 5 (268→922) not taken.
✓ Branch 6 (270→271) taken 1 times.
✗ Branch 7 (270→915) not taken.
✓ Branch 8 (271→272) taken 1 times.
✗ Branch 9 (271→913) not taken.
✓ Branch 10 (272→273) taken 1 times.
✗ Branch 11 (272→911) not taken.
✗ Branch 12 (273→274) not taken.
✓ Branch 13 (273→275) taken 1 times.
✓ Branch 14 (279→280) taken 1 times.
✓ Branch 15 (279→282) taken 1 times.
✓ Branch 16 (284→285) taken 1 times.
✓ Branch 17 (284→287) taken 1 times.
✗ Branch 18 (916→917) not taken.
✗ Branch 19 (916→919) not taken.
✗ Branch 20 (923→924) not taken.
✗ Branch 21 (923→926) not taken.
✗ Branch 22 (928→929) not taken.
✗ Branch 23 (928→931) not taken.
|
6 | assert((algo->GetOptionVector<std::string>("vector1", {"vector1"}) == std::vector<std::string>{"bee"})); |
106 |
10/20✓ Branch 0 (288→289) taken 1 times.
✗ Branch 1 (288→943) not taken.
✓ Branch 2 (290→288) taken 1 times.
✓ Branch 3 (290→291) taken 1 times.
✓ Branch 4 (291→292) taken 1 times.
✗ Branch 5 (291→938) not taken.
✓ Branch 6 (292→293) taken 1 times.
✗ Branch 7 (292→936) not taken.
✓ Branch 8 (294→295) taken 1 times.
✗ Branch 9 (294→934) not taken.
✓ Branch 10 (295→296) taken 1 times.
✗ Branch 11 (295→932) not taken.
✗ Branch 12 (296→297) not taken.
✓ Branch 13 (296→298) taken 1 times.
✓ Branch 14 (303→304) taken 1 times.
✓ Branch 15 (303→306) taken 1 times.
✗ Branch 16 (939→940) not taken.
✗ Branch 17 (939→942) not taken.
✗ Branch 18 (944→945) not taken.
✗ Branch 19 (944→947) not taken.
|
5 | assert((algo->GetOptionVector<std::string>("vector1") == std::vector<std::string>{"bee"})); |
107 | 1 | break; | |
108 | } | ||
109 | |||
110 | case 3: { | ||
111 | // test InRange tree1 | ||
112 |
10/20✓ Branch 0 (309→310) taken 1 times.
✗ Branch 1 (309→962) not taken.
✓ Branch 2 (310→311) taken 1 times.
✗ Branch 3 (310→962) not taken.
✓ Branch 4 (311→312) taken 1 times.
✗ Branch 5 (311→960) not taken.
✓ Branch 6 (315→316) taken 1 times.
✗ Branch 7 (315→952) not taken.
✓ Branch 8 (316→317) taken 1 times.
✗ Branch 9 (316→950) not taken.
✓ Branch 10 (317→318) taken 1 times.
✗ Branch 11 (317→948) not taken.
✗ Branch 12 (318→319) not taken.
✓ Branch 13 (318→320) taken 1 times.
✓ Branch 14 (323→324) taken 3 times.
✓ Branch 15 (323→326) taken 1 times.
✓ Branch 16 (329→330) taken 1 times.
✗ Branch 17 (329→981) not taken.
✗ Branch 18 (953→954) not taken.
✗ Branch 19 (953→956) not taken.
|
7 | assert((algo->GetOptionScalar<int>("t1a", {"tree1", algo->GetConfig()->InRange("test_range", 1), "val"}) == 3)); |
113 |
10/20✓ Branch 0 (330→331) taken 1 times.
✗ Branch 1 (330→981) not taken.
✓ Branch 2 (331→332) taken 1 times.
✗ Branch 3 (331→981) not taken.
✓ Branch 4 (332→333) taken 1 times.
✗ Branch 5 (332→979) not taken.
✓ Branch 6 (336→337) taken 1 times.
✗ Branch 7 (336→971) not taken.
✓ Branch 8 (337→338) taken 1 times.
✗ Branch 9 (337→969) not taken.
✓ Branch 10 (338→339) taken 1 times.
✗ Branch 11 (338→967) not taken.
✗ Branch 12 (339→340) not taken.
✓ Branch 13 (339→341) taken 1 times.
✓ Branch 14 (344→345) taken 3 times.
✓ Branch 15 (344→347) taken 1 times.
✓ Branch 16 (350→351) taken 1 times.
✗ Branch 17 (350→1000) not taken.
✗ Branch 18 (972→973) not taken.
✗ Branch 19 (972→975) not taken.
|
7 | assert((algo->GetOptionScalar<int>("t1b", {"tree1", algo->GetConfig()->InRange("test_range", 3), "val"}) == 3)); |
114 |
10/20✓ Branch 0 (351→352) taken 1 times.
✗ Branch 1 (351→1000) not taken.
✓ Branch 2 (352→353) taken 1 times.
✗ Branch 3 (352→1000) not taken.
✓ Branch 4 (353→354) taken 1 times.
✗ Branch 5 (353→998) not taken.
✓ Branch 6 (357→358) taken 1 times.
✗ Branch 7 (357→990) not taken.
✓ Branch 8 (358→359) taken 1 times.
✗ Branch 9 (358→988) not taken.
✓ Branch 10 (359→360) taken 1 times.
✗ Branch 11 (359→986) not taken.
✗ Branch 12 (360→361) not taken.
✓ Branch 13 (360→362) taken 1 times.
✓ Branch 14 (365→366) taken 3 times.
✓ Branch 15 (365→368) taken 1 times.
✓ Branch 16 (371→372) taken 1 times.
✗ Branch 17 (371→1019) not taken.
✗ Branch 18 (991→992) not taken.
✗ Branch 19 (991→994) not taken.
|
7 | assert((algo->GetOptionScalar<int>("t1c", {"tree1", algo->GetConfig()->InRange("test_range", 5), "val"}) == 3)); // at a border |
115 |
10/20✓ Branch 0 (372→373) taken 1 times.
✗ Branch 1 (372→1019) not taken.
✓ Branch 2 (373→374) taken 1 times.
✗ Branch 3 (373→1019) not taken.
✓ Branch 4 (374→375) taken 1 times.
✗ Branch 5 (374→1017) not taken.
✓ Branch 6 (378→379) taken 1 times.
✗ Branch 7 (378→1009) not taken.
✓ Branch 8 (379→380) taken 1 times.
✗ Branch 9 (379→1007) not taken.
✓ Branch 10 (380→381) taken 1 times.
✗ Branch 11 (380→1005) not taken.
✗ Branch 12 (381→382) not taken.
✓ Branch 13 (381→383) taken 1 times.
✓ Branch 14 (386→387) taken 3 times.
✓ Branch 15 (386→389) taken 1 times.
✓ Branch 16 (392→393) taken 1 times.
✗ Branch 17 (392→1038) not taken.
✗ Branch 18 (1010→1011) not taken.
✗ Branch 19 (1010→1013) not taken.
|
7 | assert((algo->GetOptionScalar<int>("t1d", {"tree1", algo->GetConfig()->InRange("test_range", 6), "val"}) == 4)); |
116 |
10/20✓ Branch 0 (393→394) taken 1 times.
✗ Branch 1 (393→1038) not taken.
✓ Branch 2 (394→395) taken 1 times.
✗ Branch 3 (394→1038) not taken.
✓ Branch 4 (395→396) taken 1 times.
✗ Branch 5 (395→1036) not taken.
✓ Branch 6 (399→400) taken 1 times.
✗ Branch 7 (399→1028) not taken.
✓ Branch 8 (400→401) taken 1 times.
✗ Branch 9 (400→1026) not taken.
✓ Branch 10 (401→402) taken 1 times.
✗ Branch 11 (401→1024) not taken.
✗ Branch 12 (402→403) not taken.
✓ Branch 13 (402→404) taken 1 times.
✓ Branch 14 (407→408) taken 3 times.
✓ Branch 15 (407→410) taken 1 times.
✓ Branch 16 (413→414) taken 1 times.
✗ Branch 17 (413→1057) not taken.
✗ Branch 18 (1029→1030) not taken.
✗ Branch 19 (1029→1032) not taken.
|
7 | assert((algo->GetOptionScalar<int>("t1e", {"tree1", algo->GetConfig()->InRange("test_range", 10), "val"}) == 4)); |
117 |
10/20✓ Branch 0 (414→415) taken 1 times.
✗ Branch 1 (414→1057) not taken.
✓ Branch 2 (415→416) taken 1 times.
✗ Branch 3 (415→1057) not taken.
✓ Branch 4 (416→417) taken 1 times.
✗ Branch 5 (416→1055) not taken.
✓ Branch 6 (420→421) taken 1 times.
✗ Branch 7 (420→1047) not taken.
✓ Branch 8 (421→422) taken 1 times.
✗ Branch 9 (421→1045) not taken.
✓ Branch 10 (422→423) taken 1 times.
✗ Branch 11 (422→1043) not taken.
✗ Branch 12 (423→424) not taken.
✓ Branch 13 (423→425) taken 1 times.
✓ Branch 14 (428→429) taken 3 times.
✓ Branch 15 (428→431) taken 1 times.
✓ Branch 16 (434→435) taken 1 times.
✗ Branch 17 (434→1076) not taken.
✗ Branch 18 (1048→1049) not taken.
✗ Branch 19 (1048→1051) not taken.
|
7 | assert((algo->GetOptionScalar<int>("t1f", {"tree1", algo->GetConfig()->InRange("test_range", 11), "val"}) == 0)); // default fallback |
118 |
10/20✓ Branch 0 (435→436) taken 1 times.
✗ Branch 1 (435→1076) not taken.
✓ Branch 2 (436→437) taken 1 times.
✗ Branch 3 (436→1076) not taken.
✓ Branch 4 (437→438) taken 1 times.
✗ Branch 5 (437→1074) not taken.
✓ Branch 6 (441→442) taken 1 times.
✗ Branch 7 (441→1066) not taken.
✓ Branch 8 (442→443) taken 1 times.
✗ Branch 9 (442→1064) not taken.
✓ Branch 10 (443→444) taken 1 times.
✗ Branch 11 (443→1062) not taken.
✗ Branch 12 (444→445) not taken.
✓ Branch 13 (444→446) taken 1 times.
✓ Branch 14 (449→450) taken 3 times.
✓ Branch 15 (449→452) taken 1 times.
✓ Branch 16 (455→456) taken 1 times.
✗ Branch 17 (455→1095) not taken.
✗ Branch 18 (1067→1068) not taken.
✗ Branch 19 (1067→1070) not taken.
|
7 | assert((algo->GetOptionScalar<int>("t1g", {"tree1", algo->GetConfig()->InRange("test_range", 10.1), "val"}) == 0)); // wrong type |
119 |
10/20✓ Branch 0 (456→457) taken 1 times.
✗ Branch 1 (456→1095) not taken.
✓ Branch 2 (457→458) taken 1 times.
✗ Branch 3 (457→1095) not taken.
✓ Branch 4 (458→459) taken 1 times.
✗ Branch 5 (458→1093) not taken.
✓ Branch 6 (462→463) taken 1 times.
✗ Branch 7 (462→1085) not taken.
✓ Branch 8 (463→464) taken 1 times.
✗ Branch 9 (463→1083) not taken.
✓ Branch 10 (464→465) taken 1 times.
✗ Branch 11 (464→1081) not taken.
✗ Branch 12 (465→466) not taken.
✓ Branch 13 (465→467) taken 1 times.
✓ Branch 14 (470→471) taken 3 times.
✓ Branch 15 (470→473) taken 1 times.
✓ Branch 16 (476→477) taken 1 times.
✗ Branch 17 (476→1114) not taken.
✗ Branch 18 (1086→1087) not taken.
✗ Branch 19 (1086→1089) not taken.
|
7 | assert((algo->GetOptionScalar<int>("t1h", {"tree1", algo->GetConfig()->InRange("test_range", 3.7), "val"}) == 3)); // wrong type |
120 | // test InRange tree2 | ||
121 |
10/20✓ Branch 0 (477→478) taken 1 times.
✗ Branch 1 (477→1114) not taken.
✓ Branch 2 (478→479) taken 1 times.
✗ Branch 3 (478→1114) not taken.
✓ Branch 4 (479→480) taken 1 times.
✗ Branch 5 (479→1112) not taken.
✓ Branch 6 (484→485) taken 1 times.
✗ Branch 7 (484→1104) not taken.
✓ Branch 8 (485→486) taken 1 times.
✗ Branch 9 (485→1102) not taken.
✓ Branch 10 (486→487) taken 1 times.
✗ Branch 11 (486→1100) not taken.
✗ Branch 12 (487→488) not taken.
✓ Branch 13 (487→489) taken 1 times.
✓ Branch 14 (493→494) taken 4 times.
✓ Branch 15 (493→496) taken 1 times.
✓ Branch 16 (499→500) taken 1 times.
✗ Branch 17 (499→1133) not taken.
✗ Branch 18 (1105→1106) not taken.
✗ Branch 19 (1105→1108) not taken.
|
8 | assert((algo->GetOptionScalar<std::string>("t2a", {"tree2", algo->GetConfig()->InRange("test_range", 1.9), "subtree", "lizard"}) == "iguana")); |
122 |
10/20✓ Branch 0 (500→501) taken 1 times.
✗ Branch 1 (500→1133) not taken.
✓ Branch 2 (501→502) taken 1 times.
✗ Branch 3 (501→1133) not taken.
✓ Branch 4 (502→503) taken 1 times.
✗ Branch 5 (502→1131) not taken.
✓ Branch 6 (507→508) taken 1 times.
✗ Branch 7 (507→1123) not taken.
✓ Branch 8 (508→509) taken 1 times.
✗ Branch 9 (508→1121) not taken.
✓ Branch 10 (509→510) taken 1 times.
✗ Branch 11 (509→1119) not taken.
✗ Branch 12 (510→511) not taken.
✓ Branch 13 (510→512) taken 1 times.
✓ Branch 14 (515→516) taken 4 times.
✓ Branch 15 (515→518) taken 1 times.
✓ Branch 16 (521→522) taken 1 times.
✗ Branch 17 (521→1157) not taken.
✗ Branch 18 (1124→1125) not taken.
✗ Branch 19 (1124→1127) not taken.
|
8 | assert((algo->GetOptionScalar<int>("t2b", {"tree2", algo->GetConfig()->InRange("test_range", 1.9), "subtree", "number"}) == 7)); |
123 |
14/30✓ Branch 0 (522→523) taken 1 times.
✗ Branch 1 (522→1157) not taken.
✓ Branch 2 (523→524) taken 1 times.
✗ Branch 3 (523→1157) not taken.
✓ Branch 4 (524→525) taken 1 times.
✗ Branch 5 (524→1155) not taken.
✓ Branch 6 (528→529) taken 1 times.
✗ Branch 7 (528→1152) not taken.
✓ Branch 8 (529→530) taken 1 times.
✗ Branch 9 (529→1152) not taken.
✓ Branch 10 (530→531) taken 1 times.
✗ Branch 11 (530→1150) not taken.
✓ Branch 12 (534→535) taken 1 times.
✗ Branch 13 (534→1142) not taken.
✓ Branch 14 (535→536) taken 1 times.
✗ Branch 15 (535→1140) not taken.
✓ Branch 16 (536→537) taken 1 times.
✗ Branch 17 (536→1138) not taken.
✗ Branch 18 (537→538) not taken.
✓ Branch 19 (537→539) taken 1 times.
✓ Branch 20 (542→543) taken 5 times.
✓ Branch 21 (542→545) taken 1 times.
✗ Branch 22 (548→549) not taken.
✓ Branch 23 (548→550) taken 1 times.
✓ Branch 24 (551→552) taken 1 times.
✗ Branch 25 (551→1181) not taken.
✗ Branch 26 (1143→1144) not taken.
✗ Branch 27 (1143→1146) not taken.
✗ Branch 28 (1152→1153) not taken.
✗ Branch 29 (1152→1154) not taken.
|
11 | assert((algo->GetOptionScalar<int>("t2c", {"tree2", algo->GetConfig()->InRange("test_range", 3.0), "subtree", algo->GetConfig()->InRange("sub_range", 1), "val"}) == 7)); |
124 |
14/30✓ Branch 0 (552→553) taken 1 times.
✗ Branch 1 (552→1181) not taken.
✓ Branch 2 (553→554) taken 1 times.
✗ Branch 3 (553→1181) not taken.
✓ Branch 4 (554→555) taken 1 times.
✗ Branch 5 (554→1179) not taken.
✓ Branch 6 (558→559) taken 1 times.
✗ Branch 7 (558→1176) not taken.
✓ Branch 8 (559→560) taken 1 times.
✗ Branch 9 (559→1176) not taken.
✓ Branch 10 (560→561) taken 1 times.
✗ Branch 11 (560→1174) not taken.
✓ Branch 12 (564→565) taken 1 times.
✗ Branch 13 (564→1166) not taken.
✓ Branch 14 (565→566) taken 1 times.
✗ Branch 15 (565→1164) not taken.
✓ Branch 16 (566→567) taken 1 times.
✗ Branch 17 (566→1162) not taken.
✗ Branch 18 (567→568) not taken.
✓ Branch 19 (567→569) taken 1 times.
✓ Branch 20 (572→573) taken 5 times.
✓ Branch 21 (572→575) taken 1 times.
✗ Branch 22 (578→579) not taken.
✓ Branch 23 (578→580) taken 1 times.
✓ Branch 24 (581→582) taken 1 times.
✗ Branch 25 (581→1205) not taken.
✗ Branch 26 (1167→1168) not taken.
✗ Branch 27 (1167→1170) not taken.
✗ Branch 28 (1176→1177) not taken.
✗ Branch 29 (1176→1178) not taken.
|
11 | assert((algo->GetOptionScalar<int>("t2d", {"tree2", algo->GetConfig()->InRange("test_range", 3.0), "subtree", algo->GetConfig()->InRange("sub_range", 8), "val"}) == 8)); |
125 |
14/30✓ Branch 0 (582→583) taken 1 times.
✗ Branch 1 (582→1205) not taken.
✓ Branch 2 (583→584) taken 1 times.
✗ Branch 3 (583→1205) not taken.
✓ Branch 4 (584→585) taken 1 times.
✗ Branch 5 (584→1203) not taken.
✓ Branch 6 (588→589) taken 1 times.
✗ Branch 7 (588→1200) not taken.
✓ Branch 8 (589→590) taken 1 times.
✗ Branch 9 (589→1200) not taken.
✓ Branch 10 (590→591) taken 1 times.
✗ Branch 11 (590→1198) not taken.
✓ Branch 12 (594→595) taken 1 times.
✗ Branch 13 (594→1190) not taken.
✓ Branch 14 (595→596) taken 1 times.
✗ Branch 15 (595→1188) not taken.
✓ Branch 16 (596→597) taken 1 times.
✗ Branch 17 (596→1186) not taken.
✗ Branch 18 (597→598) not taken.
✓ Branch 19 (597→599) taken 1 times.
✓ Branch 20 (602→603) taken 5 times.
✓ Branch 21 (602→605) taken 1 times.
✗ Branch 22 (608→609) not taken.
✓ Branch 23 (608→610) taken 1 times.
✓ Branch 24 (611→612) taken 1 times.
✗ Branch 25 (611→1224) not taken.
✗ Branch 26 (1191→1192) not taken.
✗ Branch 27 (1191→1194) not taken.
✗ Branch 28 (1200→1201) not taken.
✗ Branch 29 (1200→1202) not taken.
|
11 | assert((algo->GetOptionScalar<int>("t2e", {"tree2", algo->GetConfig()->InRange("test_range", 3.5), "subtree", algo->GetConfig()->InRange("sub_range", 11), "val"}) == 1)); |
126 |
10/20✓ Branch 0 (612→613) taken 1 times.
✗ Branch 1 (612→1224) not taken.
✓ Branch 2 (613→614) taken 1 times.
✗ Branch 3 (613→1224) not taken.
✓ Branch 4 (614→615) taken 1 times.
✗ Branch 5 (614→1222) not taken.
✓ Branch 6 (618→619) taken 1 times.
✗ Branch 7 (618→1214) not taken.
✓ Branch 8 (619→620) taken 1 times.
✗ Branch 9 (619→1212) not taken.
✓ Branch 10 (620→621) taken 1 times.
✗ Branch 11 (620→1210) not taken.
✗ Branch 12 (621→622) not taken.
✓ Branch 13 (621→623) taken 1 times.
✓ Branch 14 (626→627) taken 3 times.
✓ Branch 15 (626→629) taken 1 times.
✓ Branch 16 (632→633) taken 1 times.
✗ Branch 17 (632→1243) not taken.
✗ Branch 18 (1215→1216) not taken.
✗ Branch 19 (1215→1218) not taken.
|
7 | assert((algo->GetOptionScalar<int>("t2f", {"tree2", algo->GetConfig()->InRange("test_range", 4.0), "subtree"}) == 10)); |
127 | // test InRange tree3 | ||
128 |
10/22✓ Branch 0 (633→634) taken 1 times.
✗ Branch 1 (633→1243) not taken.
✓ Branch 2 (634→635) taken 1 times.
✗ Branch 3 (634→1243) not taken.
✓ Branch 4 (635→636) taken 1 times.
✗ Branch 5 (635→1241) not taken.
✓ Branch 6 (639→640) taken 1 times.
✗ Branch 7 (639→1233) not taken.
✓ Branch 8 (640→641) taken 1 times.
✗ Branch 9 (640→1231) not taken.
✓ Branch 10 (641→642) taken 1 times.
✗ Branch 11 (641→1229) not taken.
✗ Branch 12 (642→643) not taken.
✓ Branch 13 (642→644) taken 1 times.
✓ Branch 14 (647→648) taken 3 times.
✓ Branch 15 (647→650) taken 1 times.
✓ Branch 16 (653→654) taken 1 times.
✗ Branch 17 (653→1262) not taken.
✗ Branch 18 (1234→1235) not taken.
✗ Branch 19 (1234→1237) not taken.
✗ Branch 20 (1274→1275) not taken.
✗ Branch 21 (1274→1277) not taken.
|
7 | assert((algo->GetOptionScalar<int>("t3a", {"tree3", algo->GetConfig()->InRange("test_range", 3), "val"}) == 3)); |
129 | try { | ||
130 |
8/18✓ Branch 0 (654→655) taken 1 times.
✗ Branch 1 (654→1262) not taken.
✓ Branch 2 (655→656) taken 1 times.
✗ Branch 3 (655→1262) not taken.
✓ Branch 4 (656→657) taken 1 times.
✗ Branch 5 (656→1260) not taken.
✓ Branch 6 (660→661) taken 1 times.
✗ Branch 7 (660→1252) not taken.
✓ Branch 8 (661→662) taken 1 times.
✗ Branch 9 (661→1250) not taken.
✗ Branch 10 (662→663) not taken.
✓ Branch 11 (662→1248) taken 1 times.
✗ Branch 12 (663→664) not taken.
✗ Branch 13 (663→665) not taken.
✗ Branch 14 (668→669) not taken.
✗ Branch 15 (668→671) not taken.
✓ Branch 16 (1253→1254) taken 3 times.
✓ Branch 17 (1253→1256) taken 1 times.
|
7 | assert((algo->GetOptionScalar<int>("t3b", {"tree3", algo->GetConfig()->InRange("test_range", 11), "val"}) == 0)); |
131 | ✗ | fmt::print(stderr, "ERROR: accessing a missing default value for `InRange` did not throw exception\n"); | |
132 | ✗ | return 1; | |
133 | } | ||
134 |
1/2✗ Branch 0 (1267→1268) not taken.
✓ Branch 1 (1267→1269) taken 1 times.
|
1 | catch(std::exception const& ex) { |
135 | 1 | fmt::print("SUCCESS: accessing a missing default value for `InRange` threw expected exception\n"); | |
136 | 1 | } | |
137 | break; | ||
138 | } | ||
139 | |||
140 | default: | ||
141 | ✗ | fmt::print(stderr, "ERROR: unknown test number '{}'", test_num); | |
142 | ✗ | return 1; | |
143 | } | ||
144 | return 0; | ||
145 |
1/42✗ Branch 0 (835→836) not taken.
✗ Branch 1 (835→838) not taken.
✗ Branch 2 (849→850) not taken.
✗ Branch 3 (849→852) not taken.
✗ Branch 4 (863→864) not taken.
✗ Branch 5 (863→866) not taken.
✗ Branch 6 (877→878) not taken.
✗ Branch 7 (877→880) not taken.
✗ Branch 8 (903→904) not taken.
✗ Branch 9 (903→906) not taken.
✗ Branch 10 (963→964) not taken.
✗ Branch 11 (963→966) not taken.
✗ Branch 12 (982→983) not taken.
✗ Branch 13 (982→985) not taken.
✗ Branch 14 (1001→1002) not taken.
✗ Branch 15 (1001→1004) not taken.
✗ Branch 16 (1020→1021) not taken.
✗ Branch 17 (1020→1023) not taken.
✗ Branch 18 (1039→1040) not taken.
✗ Branch 19 (1039→1042) not taken.
✗ Branch 20 (1058→1059) not taken.
✗ Branch 21 (1058→1061) not taken.
✗ Branch 22 (1077→1078) not taken.
✗ Branch 23 (1077→1080) not taken.
✗ Branch 24 (1096→1097) not taken.
✗ Branch 25 (1096→1099) not taken.
✗ Branch 26 (1115→1116) not taken.
✗ Branch 27 (1115→1118) not taken.
✗ Branch 28 (1134→1135) not taken.
✗ Branch 29 (1134→1137) not taken.
✗ Branch 30 (1158→1159) not taken.
✗ Branch 31 (1158→1161) not taken.
✗ Branch 32 (1182→1183) not taken.
✗ Branch 33 (1182→1185) not taken.
✗ Branch 34 (1206→1207) not taken.
✗ Branch 35 (1206→1209) not taken.
✗ Branch 36 (1225→1226) not taken.
✗ Branch 37 (1225→1228) not taken.
✗ Branch 38 (1244→1245) not taken.
✗ Branch 39 (1244→1247) not taken.
✗ Branch 40 (1263→1264) not taken.
✓ Branch 41 (1263→1266) taken 1 times.
|
4 | } |
146 |