blob: 8ce6f4e72bd3666f03284100ed1797453b24769e [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
Stefaneb8b04a2022-04-25 11:01:11 +020019
20root
21outside of subcase
22inside subcase 0
23outside of subcase
24inside subcase 1
25outside of subcase
26inside subcase 2
27
28root
29outside of subcase
30also inside 0
31outside of subcase
32also inside 1
33outside of subcase
34also inside 2
35
36root
37outside of subcase
38fail inside 0
39outside of subcase
40===============================================================================
41subcases.cpp(0):
42TEST CASE: reentering subcase via regular control flow
43
44DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE):
45
46subcases.cpp(0): FATAL ERROR: 1
47
48
49root
50outside of subcase
51inside outside
52nested twice 0, 0
53nested twice 0, 1
54nested twice 0, 2
55outside of subcase
56inside outside
57nested twice 1, 0
58nested twice 1, 1
59nested twice 1, 2
60outside of subcase
61inside outside
62nested twice 2, 0
63nested twice 2, 1
64nested twice 2, 2
65
66root
67outside of subcase
68inside outside
69also twice 0, 0
70also twice 0, 1
71also twice 0, 2
72outside of subcase
73inside outside
74also twice 1, 0
75also twice 1, 1
76also twice 1, 2
77outside of subcase
78inside outside
79also twice 2, 0
80also twice 2, 1
81also twice 2, 2
onqtam35c14cd2017-04-24 12:54:03 +030082===============================================================================
onqtam1655b242018-05-10 15:29:21 +030083subcases.cpp(0):
onqtam35c14cd2017-04-24 12:54:03 +030084TEST CASE: subcases can be used in a separate function as well
onqtam5dbcb1e2017-05-02 23:07:56 +030085 from function...
86
onqtam1655b242018-05-10 15:29:21 +030087subcases.cpp(0): MESSAGE: print me twice
onqtam5dbcb1e2017-05-02 23:07:56 +030088
89===============================================================================
onqtam1655b242018-05-10 15:29:21 +030090subcases.cpp(0):
onqtam5dbcb1e2017-05-02 23:07:56 +030091TEST CASE: subcases can be used in a separate function as well
92 from function...
onqtam378d6702017-04-19 11:30:03 +030093 sc1
94
onqtam1655b242018-05-10 15:29:21 +030095subcases.cpp(0): MESSAGE: hello! from sc1
onqtam378d6702017-04-19 11:30:03 +030096
onqtam35c14cd2017-04-24 12:54:03 +030097===============================================================================
onqtam1655b242018-05-10 15:29:21 +030098subcases.cpp(0):
onqtam35c14cd2017-04-24 12:54:03 +030099TEST CASE: subcases can be used in a separate function as well
onqtama82c1e42017-05-07 17:36:41 +0300100
onqtam72bf24e2020-05-17 20:19:54 +0300101DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE):
102 from function...
103 sc1
104
onqtam1655b242018-05-10 15:29:21 +0300105subcases.cpp(0): MESSAGE: lala
onqtama82c1e42017-05-07 17:36:41 +0300106
107===============================================================================
onqtam1655b242018-05-10 15:29:21 +0300108subcases.cpp(0):
onqtama82c1e42017-05-07 17:36:41 +0300109TEST CASE: subcases can be used in a separate function as well
onqtam5dbcb1e2017-05-02 23:07:56 +0300110 from function...
111
onqtam1655b242018-05-10 15:29:21 +0300112subcases.cpp(0): MESSAGE: print me twice
onqtam5dbcb1e2017-05-02 23:07:56 +0300113
114===============================================================================
onqtam1655b242018-05-10 15:29:21 +0300115subcases.cpp(0):
onqtam5dbcb1e2017-05-02 23:07:56 +0300116TEST CASE: subcases can be used in a separate function as well
117 from function...
onqtam378d6702017-04-19 11:30:03 +0300118 sc2
119
onqtam1655b242018-05-10 15:29:21 +0300120subcases.cpp(0): MESSAGE: hello! from sc2
onqtam378d6702017-04-19 11:30:03 +0300121
onqtam35c14cd2017-04-24 12:54:03 +0300122===============================================================================
onqtam1655b242018-05-10 15:29:21 +0300123subcases.cpp(0):
onqtama82c1e42017-05-07 17:36:41 +0300124TEST CASE: subcases can be used in a separate function as well
125
onqtam72bf24e2020-05-17 20:19:54 +0300126DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE):
127 from function...
128 sc2
129
onqtam1655b242018-05-10 15:29:21 +0300130subcases.cpp(0): MESSAGE: lala
onqtama82c1e42017-05-07 17:36:41 +0300131
132===============================================================================
onqtam1655b242018-05-10 15:29:21 +0300133subcases.cpp(0):
onqtam2c100d62017-04-16 22:47:28 +0300134 Scenario: vectors can be sized and resized
135 Given: A vector with some items
136 When: the size is increased
137 Then: the size and capacity change
138
onqtam1655b242018-05-10 15:29:21 +0300139subcases.cpp(0): ERROR: CHECK( v.size() == 20 ) is NOT correct!
140 values: CHECK( 10 == 20 )
onqtam2c100d62017-04-16 22:47:28 +0300141
onqtam35c14cd2017-04-24 12:54:03 +0300142===============================================================================
onqtam1655b242018-05-10 15:29:21 +0300143subcases.cpp(0):
onqtam2c100d62017-04-16 22:47:28 +0300144 Scenario: vectors can be sized and resized
145 Given: A vector with some items
146 When: less capacity is reserved
147 Then: neither size nor capacity are changed
148
onqtam1655b242018-05-10 15:29:21 +0300149subcases.cpp(0): ERROR: CHECK( v.size() == 10 ) is NOT correct!
150 values: CHECK( 5 == 10 )
onqtam2c100d62017-04-16 22:47:28 +0300151
onqtam2c100d62017-04-16 22:47:28 +0300152===============================================================================
onqtamdc011982018-10-24 16:57:10 +0300153subcases.cpp(0):
154TEST CASE: test case should fail even though the last subcase passes
155 one
156
157subcases.cpp(0): ERROR: CHECK( false ) is NOT correct!
158 values: CHECK( false )
159
160===============================================================================
onqtamb656d602019-03-18 18:33:00 +0200161subcases.cpp(0):
162TEST CASE: fails from an exception but gets re-entered to traverse all subcases
163 level zero
164 one
165
166subcases.cpp(0): ERROR: CHECK( false ) is NOT correct!
167 values: CHECK( false )
168
169===============================================================================
170subcases.cpp(0):
171TEST CASE: fails from an exception but gets re-entered to traverse all subcases
onqtam2e137ae2019-09-22 21:06:02 +0300172 level zero
173
onqtam72bf24e2020-05-17 20:19:54 +0300174DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE):
175 level zero
176 one
177
onqtam2e137ae2019-09-22 21:06:02 +0300178subcases.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)
179
180===============================================================================
181subcases.cpp(0):
182TEST CASE: fails from an exception but gets re-entered to traverse all subcases
onqtamb656d602019-03-18 18:33:00 +0200183
onqtam72bf24e2020-05-17 20:19:54 +0300184DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE):
185 level zero
186 one
187
onqtamb656d602019-03-18 18:33:00 +0200188subcases.cpp(0): ERROR: test case THREW exception: failure... but the show must go on!
189
190===============================================================================
191subcases.cpp(0):
192TEST CASE: fails from an exception but gets re-entered to traverse all subcases
193 level zero
194 two
195
196subcases.cpp(0): ERROR: CHECK( false ) is NOT correct!
197 values: CHECK( false )
198
199===============================================================================
200subcases.cpp(0):
201TEST CASE: fails from an exception but gets re-entered to traverse all subcases
onqtam2e137ae2019-09-22 21:06:02 +0300202 level zero
203
onqtam72bf24e2020-05-17 20:19:54 +0300204DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE):
205 level zero
206 two
207
onqtam2e137ae2019-09-22 21:06:02 +0300208subcases.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)
209
210===============================================================================
211subcases.cpp(0):
212TEST CASE: fails from an exception but gets re-entered to traverse all subcases
onqtamb656d602019-03-18 18:33:00 +0200213
onqtam72bf24e2020-05-17 20:19:54 +0300214DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE):
215 level zero
216 two
217
onqtamb656d602019-03-18 18:33:00 +0200218subcases.cpp(0): ERROR: test case THREW exception: failure... but the show must go on!
219
220===============================================================================
onqtam33752222020-02-24 18:35:42 +0200221subcases.cpp(0):
222TEST CASE: subcases with changing names
223 outer 0
224 inner 0
225
226subcases.cpp(0): MESSAGE: msg!
227
228===============================================================================
229subcases.cpp(0):
230TEST CASE: subcases with changing names
231 outer 0
232 inner 1
233
234subcases.cpp(0): MESSAGE: msg!
235
236===============================================================================
237subcases.cpp(0):
238TEST CASE: subcases with changing names
239 outer 1
240 inner 0
241
242subcases.cpp(0): MESSAGE: msg!
243
244===============================================================================
245subcases.cpp(0):
246TEST CASE: subcases with changing names
247 outer 1
248 inner 1
249
250subcases.cpp(0): MESSAGE: msg!
251
252===============================================================================
253subcases.cpp(0):
254TEST CASE: subcases with changing names
255 separate
256
257subcases.cpp(0): MESSAGE: separate msg!
258
259===============================================================================
Egor Suvorovbef19652022-03-05 15:36:58 +0300260subcases.cpp(0):
261TEST SUITE: with a funny name,
262TEST CASE: with a funnier name\:
263 with the funniest name\,
264
265subcases.cpp(0): MESSAGE: Yes!
266
267===============================================================================
268subcases.cpp(0):
269TEST SUITE: with a funny name,
270TEST CASE: with a funnier name\:
271 with a slightly funny name :
272
273subcases.cpp(0): MESSAGE: Yep!
274
275===============================================================================
276subcases.cpp(0):
277TEST SUITE: with a funny name,
278TEST CASE: with a funnier name\:
279 without a funny name
280
281subcases.cpp(0): MESSAGE: NO!
282
283===============================================================================
284subcases.cpp(0):
285TEST SUITE: with a funny name,
286TEST CASE: without a funny name:
287
288subcases.cpp(0): MESSAGE: Nooo
289
290===============================================================================
Stefaneb8b04a2022-04-25 11:01:11 +0200291[doctest] test cases: 10 | 5 passed | 5 failed |
292[doctest] assertions: 26 | 19 passed | 7 failed |
onqtam754f4022017-05-06 20:07:49 +0300293[doctest] Status: FAILURE!
onqtam2c100d62017-04-16 22:47:28 +0300294Program code.