blob: c3138d341b457b298719e073351ae9f28c00c6b7 [file] [log] [blame]
onqtam2c100d62017-04-16 22:47:28 +03001[doctest] run with "--help" for options
onqtam27079bc2017-04-16 23:21:13 +03002
3root
41
51.1
6
7root
82
92.1
10
11root
122
onqtam35c14cd2017-04-24 12:54:03 +030013===============================================================================
onqtam1655b242018-05-10 15:29:21 +030014subcases.cpp(0):
onqtam35c14cd2017-04-24 12:54:03 +030015TEST CASE: lots of nested subcases
onqtam27079bc2017-04-16 23:21:13 +030016
onqtam1655b242018-05-10 15:29:21 +030017subcases.cpp(0): FATAL ERROR:
onqtam27079bc2017-04-16 23:21:13 +030018
onqtam35c14cd2017-04-24 12:54:03 +030019===============================================================================
onqtam1655b242018-05-10 15:29:21 +030020subcases.cpp(0):
onqtam35c14cd2017-04-24 12:54:03 +030021TEST CASE: subcases can be used in a separate function as well
onqtam5dbcb1e2017-05-02 23:07:56 +030022 from function...
23
onqtam1655b242018-05-10 15:29:21 +030024subcases.cpp(0): MESSAGE: print me twice
onqtam5dbcb1e2017-05-02 23:07:56 +030025
26===============================================================================
onqtam1655b242018-05-10 15:29:21 +030027subcases.cpp(0):
onqtam5dbcb1e2017-05-02 23:07:56 +030028TEST CASE: subcases can be used in a separate function as well
29 from function...
onqtam378d6702017-04-19 11:30:03 +030030 sc1
31
onqtam1655b242018-05-10 15:29:21 +030032subcases.cpp(0): MESSAGE: hello! from sc1
onqtam378d6702017-04-19 11:30:03 +030033
onqtam35c14cd2017-04-24 12:54:03 +030034===============================================================================
onqtam1655b242018-05-10 15:29:21 +030035subcases.cpp(0):
onqtam35c14cd2017-04-24 12:54:03 +030036TEST CASE: subcases can be used in a separate function as well
onqtama82c1e42017-05-07 17:36:41 +030037
onqtam1655b242018-05-10 15:29:21 +030038subcases.cpp(0): MESSAGE: lala
onqtama82c1e42017-05-07 17:36:41 +030039
40===============================================================================
onqtam1655b242018-05-10 15:29:21 +030041subcases.cpp(0):
onqtama82c1e42017-05-07 17:36:41 +030042TEST CASE: subcases can be used in a separate function as well
onqtam5dbcb1e2017-05-02 23:07:56 +030043 from function...
44
onqtam1655b242018-05-10 15:29:21 +030045subcases.cpp(0): MESSAGE: print me twice
onqtam5dbcb1e2017-05-02 23:07:56 +030046
47===============================================================================
onqtam1655b242018-05-10 15:29:21 +030048subcases.cpp(0):
onqtam5dbcb1e2017-05-02 23:07:56 +030049TEST CASE: subcases can be used in a separate function as well
50 from function...
onqtam378d6702017-04-19 11:30:03 +030051 sc2
52
onqtam1655b242018-05-10 15:29:21 +030053subcases.cpp(0): MESSAGE: hello! from sc2
onqtam378d6702017-04-19 11:30:03 +030054
onqtam35c14cd2017-04-24 12:54:03 +030055===============================================================================
onqtam1655b242018-05-10 15:29:21 +030056subcases.cpp(0):
onqtama82c1e42017-05-07 17:36:41 +030057TEST CASE: subcases can be used in a separate function as well
58
onqtam1655b242018-05-10 15:29:21 +030059subcases.cpp(0): MESSAGE: lala
onqtama82c1e42017-05-07 17:36:41 +030060
61===============================================================================
onqtam1655b242018-05-10 15:29:21 +030062subcases.cpp(0):
onqtam2c100d62017-04-16 22:47:28 +030063 Scenario: vectors can be sized and resized
64 Given: A vector with some items
65 When: the size is increased
66 Then: the size and capacity change
67
onqtam1655b242018-05-10 15:29:21 +030068subcases.cpp(0): ERROR: CHECK( v.size() == 20 ) is NOT correct!
69 values: CHECK( 10 == 20 )
onqtam2c100d62017-04-16 22:47:28 +030070
onqtam35c14cd2017-04-24 12:54:03 +030071===============================================================================
onqtam1655b242018-05-10 15:29:21 +030072subcases.cpp(0):
onqtam2c100d62017-04-16 22:47:28 +030073 Scenario: vectors can be sized and resized
74 Given: A vector with some items
75 When: less capacity is reserved
76 Then: neither size nor capacity are changed
77
onqtam1655b242018-05-10 15:29:21 +030078subcases.cpp(0): ERROR: CHECK( v.size() == 10 ) is NOT correct!
79 values: CHECK( 5 == 10 )
onqtam2c100d62017-04-16 22:47:28 +030080
onqtam2c100d62017-04-16 22:47:28 +030081===============================================================================
onqtamdc011982018-10-24 16:57:10 +030082subcases.cpp(0):
83TEST CASE: test case should fail even though the last subcase passes
84 one
85
86subcases.cpp(0): ERROR: CHECK( false ) is NOT correct!
87 values: CHECK( false )
88
89===============================================================================
onqtamb656d602019-03-18 18:33:00 +020090subcases.cpp(0):
91TEST CASE: fails from an exception but gets re-entered to traverse all subcases
92 level zero
93 one
94
95subcases.cpp(0): ERROR: CHECK( false ) is NOT correct!
96 values: CHECK( false )
97
98===============================================================================
99subcases.cpp(0):
100TEST CASE: fails from an exception but gets re-entered to traverse all subcases
onqtam2e137ae2019-09-22 21:06:02 +0300101 level zero
102
103subcases.cpp(0): ERROR: test case THREW exception: exception thrown in subcase - will translate later when the whole test case has been exited (cannot translate while there is an active exception)
104
105===============================================================================
106subcases.cpp(0):
107TEST CASE: fails from an exception but gets re-entered to traverse all subcases
onqtamb656d602019-03-18 18:33:00 +0200108
109subcases.cpp(0): ERROR: test case THREW exception: failure... but the show must go on!
110
111===============================================================================
112subcases.cpp(0):
113TEST CASE: fails from an exception but gets re-entered to traverse all subcases
114 level zero
115 two
116
117subcases.cpp(0): ERROR: CHECK( false ) is NOT correct!
118 values: CHECK( false )
119
120===============================================================================
121subcases.cpp(0):
122TEST CASE: fails from an exception but gets re-entered to traverse all subcases
onqtam2e137ae2019-09-22 21:06:02 +0300123 level zero
124
125subcases.cpp(0): ERROR: test case THREW exception: exception thrown in subcase - will translate later when the whole test case has been exited (cannot translate while there is an active exception)
126
127===============================================================================
128subcases.cpp(0):
129TEST CASE: fails from an exception but gets re-entered to traverse all subcases
onqtamb656d602019-03-18 18:33:00 +0200130
131subcases.cpp(0): ERROR: test case THREW exception: failure... but the show must go on!
132
133===============================================================================
onqtam33752222020-02-24 18:35:42 +0200134subcases.cpp(0):
135TEST CASE: subcases with changing names
136 outer 0
137 inner 0
138
139subcases.cpp(0): MESSAGE: msg!
140
141===============================================================================
142subcases.cpp(0):
143TEST CASE: subcases with changing names
144 outer 0
145 inner 1
146
147subcases.cpp(0): MESSAGE: msg!
148
149===============================================================================
150subcases.cpp(0):
151TEST CASE: subcases with changing names
152 outer 1
153 inner 0
154
155subcases.cpp(0): MESSAGE: msg!
156
157===============================================================================
158subcases.cpp(0):
159TEST CASE: subcases with changing names
160 outer 1
161 inner 1
162
163subcases.cpp(0): MESSAGE: msg!
164
165===============================================================================
166subcases.cpp(0):
167TEST CASE: subcases with changing names
168 separate
169
170subcases.cpp(0): MESSAGE: separate msg!
171
172===============================================================================
173[doctest] test cases: 7 | 3 passed | 4 failed |
onqtamdca8b662019-09-22 17:34:50 +0300174[doctest] assertions: 25 | 19 passed | 6 failed |
onqtam754f4022017-05-06 20:07:49 +0300175[doctest] Status: FAILURE!
onqtam2c100d62017-04-16 22:47:28 +0300176Program code.