assertion_macros.cpp_junit.txt (13378B)
1 <?xml version="1.0" encoding="UTF-8"?> 2 <testsuites> 3 <testsuite name="all_features" errors="0" failures="63" tests="98"> 4 <testcase classname="assertion_macros.cpp" name="normal macros" status="run"> 5 <failure type="CHECK"> 6 assertion_macros.cpp(0): 7 CHECK( throw_if(true, std::runtime_error("whops!")) == 42 ) THREW exception: "whops!" 8 9 </failure> 10 <failure message="Approx( 0.502 ) == 0.501" type="CHECK"> 11 assertion_macros.cpp(0): 12 CHECK( doctest::Approx(0.502) == 0.501 ) is NOT correct! 13 values: CHECK( Approx( 0.502 ) == 0.501 ) 14 15 </failure> 16 </testcase> 17 <testcase classname="assertion_macros.cpp" name="expressions should be evaluated only once" status="run"/> 18 <testcase classname="assertion_macros.cpp" name="exceptions-related macros" status="run"> 19 <failure type="CHECK_THROWS"> 20 assertion_macros.cpp(0): 21 CHECK_THROWS( throw_if(false, 0) ) did NOT throw at all! 22 23 </failure> 24 <failure type="CHECK_THROWS_AS"> 25 assertion_macros.cpp(0): 26 CHECK_THROWS_AS( throw_if(true, 0), char ) threw a DIFFERENT exception: "0" 27 28 </failure> 29 <failure type="CHECK_THROWS_AS"> 30 assertion_macros.cpp(0): 31 CHECK_THROWS_AS( throw_if(false, 0), int ) did NOT throw at all! 32 33 </failure> 34 <failure type="CHECK_THROWS_WITH"> 35 assertion_macros.cpp(0): 36 CHECK_THROWS_WITH( throw_if(true, "whops!"), "whops! no match!" ) threw a DIFFERENT exception: "whops!" 37 38 </failure> 39 <failure type="CHECK_THROWS_WITH"> 40 assertion_macros.cpp(0): 41 CHECK_THROWS_WITH( throw_if(true, "whops! does it match?"), "whops! no match!" ) threw a DIFFERENT exception: "whops! does it match?" 42 43 </failure> 44 <failure type="CHECK_THROWS_WITH_AS"> 45 assertion_macros.cpp(0): 46 CHECK_THROWS_WITH_AS( throw_if(true, "whops!"), "whops! no match!", bool ) threw a DIFFERENT exception! (contents: "whops!") 47 48 </failure> 49 <failure type="CHECK_THROWS_WITH_AS"> 50 assertion_macros.cpp(0): 51 CHECK_THROWS_WITH_AS( throw_if(true, "whops!"), "whops!", int ) threw a DIFFERENT exception! (contents: "whops!") 52 53 </failure> 54 <failure type="CHECK_THROWS_WITH_AS"> 55 assertion_macros.cpp(0): 56 CHECK_THROWS_WITH_AS( throw_if(true, "whops! does it match?"), "whops! no match!", int ) threw a DIFFERENT exception! (contents: "whops! does it match?") 57 58 </failure> 59 <failure type="CHECK_NOTHROW"> 60 assertion_macros.cpp(0): 61 CHECK_NOTHROW( throw_if(true, 0) ) THREW exception: "0" 62 63 </failure> 64 </testcase> 65 <testcase classname="assertion_macros.cpp" name="exceptions-related macros for std::exception" status="run"> 66 <failure type="CHECK_THROWS"> 67 assertion_macros.cpp(0): 68 CHECK_THROWS( throw_if(false, 0) ) did NOT throw at all! 69 70 </failure> 71 <failure type="CHECK_THROWS_AS"> 72 assertion_macros.cpp(0): 73 CHECK_THROWS_AS( throw_if(false, std::runtime_error("whops!")), std::exception ) did NOT throw at all! 74 75 </failure> 76 <failure type="CHECK_THROWS_AS"> 77 assertion_macros.cpp(0): 78 CHECK_THROWS_AS( throw_if(true, std::runtime_error("whops!")), int ) threw a DIFFERENT exception: "whops!" 79 80 </failure> 81 <failure type="CHECK_THROWS_WITH"> 82 assertion_macros.cpp(0): 83 CHECK_THROWS_WITH( throw_if(false, ""), "whops!" ) did NOT throw at all! 84 85 </failure> 86 <failure type="REQUIRE_NOTHROW"> 87 assertion_macros.cpp(0): 88 REQUIRE_NOTHROW( throw_if(true, std::runtime_error("whops!")) ) THREW exception: "whops!" 89 90 </failure> 91 </testcase> 92 <testcase classname="assertion_macros.cpp" name="WARN level of asserts don't fail the test case" status="run"> 93 <failure message="0" type="WARN"> 94 assertion_macros.cpp(0): 95 WARN( 0 ) is NOT correct! 96 values: WARN( 0 ) 97 98 </failure> 99 <failure message="1" type="WARN_FALSE"> 100 assertion_macros.cpp(0): 101 WARN_FALSE( 1 ) is NOT correct! 102 values: WARN_FALSE( 1 ) 103 104 </failure> 105 <failure type="WARN_THROWS"> 106 assertion_macros.cpp(0): 107 WARN_THROWS( throw_if(false, 0) ) did NOT throw at all! 108 109 </failure> 110 <failure type="WARN_THROWS_WITH"> 111 assertion_macros.cpp(0): 112 WARN_THROWS_WITH( throw_if(true, ""), "whops!" ) threw a DIFFERENT exception: 113 114 </failure> 115 <failure type="WARN_THROWS_WITH"> 116 assertion_macros.cpp(0): 117 WARN_THROWS_WITH( throw_if(false, ""), "whops!" ) did NOT throw at all! 118 119 </failure> 120 <failure type="WARN_THROWS_AS"> 121 assertion_macros.cpp(0): 122 WARN_THROWS_AS( throw_if(false, 0), bool ) did NOT throw at all! 123 124 </failure> 125 <failure type="WARN_THROWS_AS"> 126 assertion_macros.cpp(0): 127 WARN_THROWS_AS( throw_if(true, 0), bool ) threw a DIFFERENT exception: "0" 128 129 </failure> 130 <failure type="WARN_THROWS_WITH_AS"> 131 assertion_macros.cpp(0): 132 WARN_THROWS_WITH_AS( throw_if(false, ""), "whops!", int ) did NOT throw at all! 133 134 </failure> 135 <failure type="WARN_THROWS_WITH_AS"> 136 assertion_macros.cpp(0): 137 WARN_THROWS_WITH_AS( throw_if(true, ""), "whops!", int ) threw a DIFFERENT exception! (contents: ) 138 139 </failure> 140 <failure type="WARN_NOTHROW"> 141 assertion_macros.cpp(0): 142 WARN_NOTHROW( throw_if(true, 0) ) THREW exception: "0" 143 144 </failure> 145 <failure message="1, 0" type="WARN_EQ"> 146 assertion_macros.cpp(0): 147 WARN_EQ( 1, 0 ) is NOT correct! 148 values: WARN_EQ( 1, 0 ) 149 150 </failure> 151 <failure message="0" type="WARN_UNARY"> 152 assertion_macros.cpp(0): 153 WARN_UNARY( 0 ) is NOT correct! 154 values: WARN_UNARY( 0 ) 155 156 </failure> 157 <failure message="1" type="WARN_UNARY_FALSE"> 158 assertion_macros.cpp(0): 159 WARN_UNARY_FALSE( 1 ) is NOT correct! 160 values: WARN_UNARY_FALSE( 1 ) 161 162 </failure> 163 </testcase> 164 <testcase classname="assertion_macros.cpp" name="CHECK level of asserts fail the test case but don't abort it" status="run"> 165 <failure message="0" type="CHECK"> 166 assertion_macros.cpp(0): 167 CHECK( 0 ) is NOT correct! 168 values: CHECK( 0 ) 169 170 </failure> 171 <failure message="1" type="CHECK_FALSE"> 172 assertion_macros.cpp(0): 173 CHECK_FALSE( 1 ) is NOT correct! 174 values: CHECK_FALSE( 1 ) 175 176 </failure> 177 <failure type="CHECK_THROWS"> 178 assertion_macros.cpp(0): 179 CHECK_THROWS( throw_if(false, 0) ) did NOT throw at all! 180 181 </failure> 182 <failure type="CHECK_THROWS_AS"> 183 assertion_macros.cpp(0): 184 CHECK_THROWS_AS( throw_if(false, 0), bool ) did NOT throw at all! 185 186 </failure> 187 <failure type="CHECK_THROWS_AS"> 188 assertion_macros.cpp(0): 189 CHECK_THROWS_AS( throw_if(true, 0), bool ) threw a DIFFERENT exception: "0" 190 191 </failure> 192 <failure type="CHECK_THROWS_WITH"> 193 assertion_macros.cpp(0): 194 CHECK_THROWS_WITH( throw_if(true, 0), "unrecognized" ) threw a DIFFERENT exception: "0" 195 196 </failure> 197 <failure type="CHECK_THROWS_WITH_AS"> 198 assertion_macros.cpp(0): 199 CHECK_THROWS_WITH_AS( throw_if(true, 0), "unrecognized", int ) threw a DIFFERENT exception! (contents: "0") 200 201 </failure> 202 <failure type="CHECK_NOTHROW"> 203 assertion_macros.cpp(0): 204 CHECK_NOTHROW( throw_if(true, 0) ) THREW exception: "0" 205 206 </failure> 207 <failure message="1, 0" type="CHECK_EQ"> 208 assertion_macros.cpp(0): 209 CHECK_EQ( 1, 0 ) is NOT correct! 210 values: CHECK_EQ( 1, 0 ) 211 212 </failure> 213 <failure message="0" type="CHECK_UNARY"> 214 assertion_macros.cpp(0): 215 CHECK_UNARY( 0 ) is NOT correct! 216 values: CHECK_UNARY( 0 ) 217 218 </failure> 219 <failure message="1" type="CHECK_UNARY_FALSE"> 220 assertion_macros.cpp(0): 221 CHECK_UNARY_FALSE( 1 ) is NOT correct! 222 values: CHECK_UNARY_FALSE( 1 ) 223 224 </failure> 225 </testcase> 226 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 1" status="run"> 227 <failure message="0" type="REQUIRE"> 228 assertion_macros.cpp(0): 229 REQUIRE( 0 ) is NOT correct! 230 values: REQUIRE( 0 ) 231 232 </failure> 233 </testcase> 234 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 2" status="run"> 235 <failure message="1" type="REQUIRE_FALSE"> 236 assertion_macros.cpp(0): 237 REQUIRE_FALSE( 1 ) is NOT correct! 238 values: REQUIRE_FALSE( 1 ) 239 240 </failure> 241 </testcase> 242 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 3" status="run"> 243 <failure type="REQUIRE_THROWS"> 244 assertion_macros.cpp(0): 245 REQUIRE_THROWS( throw_if(false, 0) ) did NOT throw at all! 246 247 </failure> 248 </testcase> 249 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 4" status="run"> 250 <failure type="REQUIRE_THROWS_AS"> 251 assertion_macros.cpp(0): 252 REQUIRE_THROWS_AS( throw_if(false, 0), bool ) did NOT throw at all! 253 254 </failure> 255 </testcase> 256 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 5" status="run"> 257 <failure type="REQUIRE_THROWS_AS"> 258 assertion_macros.cpp(0): 259 REQUIRE_THROWS_AS( throw_if(true, 0), bool ) threw a DIFFERENT exception: "0" 260 261 </failure> 262 </testcase> 263 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 6" status="run"> 264 <failure type="REQUIRE_THROWS_WITH"> 265 assertion_macros.cpp(0): 266 REQUIRE_THROWS_WITH( throw_if(false, ""), "whops!" ) did NOT throw at all! 267 268 </failure> 269 </testcase> 270 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 7" status="run"> 271 <failure type="REQUIRE_THROWS_WITH"> 272 assertion_macros.cpp(0): 273 REQUIRE_THROWS_WITH( throw_if(true, ""), "whops!" ) threw a DIFFERENT exception: 274 275 </failure> 276 </testcase> 277 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 8" status="run"> 278 <failure type="REQUIRE_THROWS_WITH_AS"> 279 assertion_macros.cpp(0): 280 REQUIRE_THROWS_WITH_AS( throw_if(false, ""), "whops!", bool ) did NOT throw at all! 281 282 </failure> 283 </testcase> 284 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 9" status="run"> 285 <failure type="REQUIRE_THROWS_WITH_AS"> 286 assertion_macros.cpp(0): 287 REQUIRE_THROWS_WITH_AS( throw_if(true, ""), "whops!", bool ) threw a DIFFERENT exception! (contents: ) 288 289 </failure> 290 </testcase> 291 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 10" status="run"> 292 <failure type="REQUIRE_NOTHROW"> 293 assertion_macros.cpp(0): 294 REQUIRE_NOTHROW( throw_if(true, 0) ) THREW exception: "0" 295 296 </failure> 297 </testcase> 298 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 11" status="run"> 299 <failure message="1, 0" type="REQUIRE_EQ"> 300 assertion_macros.cpp(0): 301 REQUIRE_EQ( 1, 0 ) is NOT correct! 302 values: REQUIRE_EQ( 1, 0 ) 303 304 </failure> 305 </testcase> 306 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 12" status="run"> 307 <failure message="0" type="REQUIRE_UNARY"> 308 assertion_macros.cpp(0): 309 REQUIRE_UNARY( 0 ) is NOT correct! 310 values: REQUIRE_UNARY( 0 ) 311 312 </failure> 313 </testcase> 314 <testcase classname="assertion_macros.cpp" name="REQUIRE level of asserts fail and abort the test case - 13" status="run"> 315 <failure message="1" type="REQUIRE_UNARY_FALSE"> 316 assertion_macros.cpp(0): 317 REQUIRE_UNARY_FALSE( 1 ) is NOT correct! 318 values: REQUIRE_UNARY_FALSE( 1 ) 319 320 </failure> 321 </testcase> 322 <testcase classname="assertion_macros.cpp" name="all binary assertions" status="run"/> 323 <testcase classname="assertion_macros.cpp" name="some asserts used in a function called by a test case" status="run"> 324 <failure type="CHECK_THROWS_WITH_AS"> 325 assertion_macros.cpp(0): 326 CHECK_THROWS_WITH_AS( throw_if(true, false), "unknown exception", int ) threw a DIFFERENT exception! (contents: "unknown exception") 327 328 </failure> 329 </testcase> 330 <testcase classname="assertion_macros.cpp" name="check return values" status="run"/> 331 <testcase classname="assertion_macros.cpp" name="check return values no print" status="run"> 332 <failure message="4 == 2" type="CHECK"> 333 assertion_macros.cpp(0): 334 CHECK( a == b ) is NOT correct! 335 values: CHECK( 4 == 2 ) 336 337 </failure> 338 <failure message="4 != 2" type="CHECK_FALSE"> 339 assertion_macros.cpp(0): 340 CHECK_FALSE( a != b ) is NOT correct! 341 values: CHECK_FALSE( 4 != 2 ) 342 343 </failure> 344 <failure message="4, 2" type="CHECK_EQ"> 345 assertion_macros.cpp(0): 346 CHECK_EQ( a, b ) is NOT correct! 347 values: CHECK_EQ( 4, 2 ) 348 349 </failure> 350 <failure message="false" type="CHECK_UNARY"> 351 assertion_macros.cpp(0): 352 CHECK_UNARY( a == b ) is NOT correct! 353 values: CHECK_UNARY( false ) 354 355 </failure> 356 <failure message="true" type="CHECK_UNARY_FALSE"> 357 assertion_macros.cpp(0): 358 CHECK_UNARY_FALSE( a != b ) is NOT correct! 359 values: CHECK_UNARY_FALSE( true ) 360 361 </failure> 362 <failure type="CHECK_THROWS"> 363 assertion_macros.cpp(0): 364 CHECK_THROWS( throw_if(false, false) ) did NOT throw at all! 365 366 </failure> 367 <failure type="CHECK_THROWS_AS"> 368 assertion_macros.cpp(0): 369 CHECK_THROWS_AS( throw_if(true, 2), doctest::Approx ) threw a DIFFERENT exception: "2" 370 371 </failure> 372 <failure type="CHECK_NOTHROW"> 373 assertion_macros.cpp(0): 374 CHECK_NOTHROW( throw_if(true, 2) ) THREW exception: "2" 375 376 </failure> 377 <failure type="CHECK_THROWS_WITH"> 378 assertion_macros.cpp(0): 379 CHECK_THROWS_WITH( throw_if(true, 2), "1" ) threw a DIFFERENT exception: "2" 380 381 </failure> 382 </testcase> 383 </testsuite> 384 </testsuites> 385 Program code.