File: logging.cpp.txt

package info (click to toggle)
doctest 2.4.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,436 kB
  • sloc: cpp: 13,546; python: 261; makefile: 30; sh: 1
file content (84 lines) | stat: -rw-r--r-- 3,060 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
[doctest] run with "--help" for options
===============================================================================
logging.cpp(0):
TEST CASE:  logging the counter of a loop

logging.cpp(0): ERROR: CHECK( vec[i] != (1 << i) ) is NOT correct!
  values: CHECK( 1 != 1 )
  logged: current iteration of loop:
          i := 0

logging.cpp(0): ERROR: CHECK( vec[i] != (1 << i) ) is NOT correct!
  values: CHECK( 2 != 2 )
  logged: current iteration of loop:
          i := 1

logging.cpp(0): ERROR: CHECK( vec[i] != (1 << i) ) is NOT correct!
  values: CHECK( 4 != 4 )
  logged: current iteration of loop:
          i := 2

logging.cpp(0): ERROR: CHECK( vec[i] != (1 << i) ) is NOT correct!
  values: CHECK( 8 != 8 )
  logged: current iteration of loop:
          i := 3

logging.cpp(0): ERROR: CHECK( vec[i] != (1 << i) ) is NOT correct!
  values: CHECK( 16 != 16 )
  logged: current iteration of loop:
          i := 4

===============================================================================
logging.cpp(0):
TEST CASE:  a test case that will end from an exception

logging.cpp(0): ERROR: forcing the many captures to be stringified
  logged: lots of captures: 42 42 42;
          old way of capturing - using the streaming operator: 42 42

logging.cpp(0): ERROR: CHECK( some_var == 666 ) is NOT correct!
  values: CHECK( 42 == 666 )
  logged: someTests() returned: 42
          this should be printed if an exception is thrown even if no assert has failed: 42
          in a nested scope this should be printed as well: 42
          why is this not 666 ?!

logging.cpp(0): ERROR: test case THREW exception: 0
  logged: someTests() returned: 42
          this should be printed if an exception is thrown even if no assert has failed: 42
          in a nested scope this should be printed as well: 42

===============================================================================
logging.cpp(0):
TEST CASE:  a test case that will end from an exception and should print the unprinted context

logging.cpp(0): ERROR: test case THREW exception: 0
  logged: should be printed even if an exception is thrown and no assert fails before that

===============================================================================
logging.cpp(0):
TEST CASE:  third party asserts can report failures to doctest

logging.cpp(0): ERROR: MY_ASSERT(false)

logging.cpp(0): FATAL ERROR: MY_ASSERT_FATAL(false)

===============================================================================
logging.cpp(0):
TEST CASE:  explicit failures 1

logging.cpp(0): ERROR: this should not end the test case, but mark it as failing

logging.cpp(0): MESSAGE: reached!

===============================================================================
logging.cpp(0):
TEST CASE:  explicit failures 2

logging.cpp(0): FATAL ERROR: fail the test case and also end it

===============================================================================
[doctest] test cases:  6 | 0 passed |  6 failed |
[doctest] assertions: 11 | 0 passed | 11 failed |
[doctest] Status: FAILURE!
Program code.