onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 1 | [doctest] run with "--help" for options |
onqtam | 27079bc | 2017-04-16 23:21:13 +0300 | [diff] [blame] | 2 | |
| 3 | root |
| 4 | 1 |
| 5 | 1.1 |
| 6 | |
| 7 | root |
| 8 | 2 |
| 9 | 2.1 |
| 10 | |
| 11 | root |
| 12 | 2 |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 13 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 14 | subcases.cpp(0): |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 15 | TEST CASE: lots of nested subcases |
onqtam | 27079bc | 2017-04-16 23:21:13 +0300 | [diff] [blame] | 16 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 17 | subcases.cpp(0): FATAL ERROR: |
onqtam | 27079bc | 2017-04-16 23:21:13 +0300 | [diff] [blame] | 18 | |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 19 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 20 | subcases.cpp(0): |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 21 | TEST CASE: subcases can be used in a separate function as well |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 22 | from function... |
| 23 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 24 | subcases.cpp(0): MESSAGE: print me twice |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 25 | |
| 26 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 27 | subcases.cpp(0): |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 28 | TEST CASE: subcases can be used in a separate function as well |
| 29 | from function... |
onqtam | 378d670 | 2017-04-19 11:30:03 +0300 | [diff] [blame] | 30 | sc1 |
| 31 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 32 | subcases.cpp(0): MESSAGE: hello! from sc1 |
onqtam | 378d670 | 2017-04-19 11:30:03 +0300 | [diff] [blame] | 33 | |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 34 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 35 | subcases.cpp(0): |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 36 | TEST CASE: subcases can be used in a separate function as well |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 37 | |
onqtam | 72bf24e | 2020-05-17 20:19:54 +0300 | [diff] [blame] | 38 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 39 | from function... |
| 40 | sc1 |
| 41 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 42 | subcases.cpp(0): MESSAGE: lala |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 43 | |
| 44 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 45 | subcases.cpp(0): |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 46 | TEST CASE: subcases can be used in a separate function as well |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 47 | from function... |
| 48 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 49 | subcases.cpp(0): MESSAGE: print me twice |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 50 | |
| 51 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 52 | subcases.cpp(0): |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 53 | TEST CASE: subcases can be used in a separate function as well |
| 54 | from function... |
onqtam | 378d670 | 2017-04-19 11:30:03 +0300 | [diff] [blame] | 55 | sc2 |
| 56 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 57 | subcases.cpp(0): MESSAGE: hello! from sc2 |
onqtam | 378d670 | 2017-04-19 11:30:03 +0300 | [diff] [blame] | 58 | |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 59 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 60 | subcases.cpp(0): |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 61 | TEST CASE: subcases can be used in a separate function as well |
| 62 | |
onqtam | 72bf24e | 2020-05-17 20:19:54 +0300 | [diff] [blame] | 63 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 64 | from function... |
| 65 | sc2 |
| 66 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 67 | subcases.cpp(0): MESSAGE: lala |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 68 | |
| 69 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 70 | subcases.cpp(0): |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 71 | Scenario: vectors can be sized and resized |
| 72 | Given: A vector with some items |
| 73 | When: the size is increased |
| 74 | Then: the size and capacity change |
| 75 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 76 | subcases.cpp(0): ERROR: CHECK( v.size() == 20 ) is NOT correct! |
| 77 | values: CHECK( 10 == 20 ) |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 78 | |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 79 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 80 | subcases.cpp(0): |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 81 | Scenario: vectors can be sized and resized |
| 82 | Given: A vector with some items |
| 83 | When: less capacity is reserved |
| 84 | Then: neither size nor capacity are changed |
| 85 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 86 | subcases.cpp(0): ERROR: CHECK( v.size() == 10 ) is NOT correct! |
| 87 | values: CHECK( 5 == 10 ) |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 88 | |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 89 | =============================================================================== |
onqtam | dc01198 | 2018-10-24 16:57:10 +0300 | [diff] [blame] | 90 | subcases.cpp(0): |
| 91 | TEST CASE: test case should fail even though the last subcase passes |
| 92 | one |
| 93 | |
| 94 | subcases.cpp(0): ERROR: CHECK( false ) is NOT correct! |
| 95 | values: CHECK( false ) |
| 96 | |
| 97 | =============================================================================== |
onqtam | b656d60 | 2019-03-18 18:33:00 +0200 | [diff] [blame] | 98 | subcases.cpp(0): |
| 99 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
| 100 | level zero |
| 101 | one |
| 102 | |
| 103 | subcases.cpp(0): ERROR: CHECK( false ) is NOT correct! |
| 104 | values: CHECK( false ) |
| 105 | |
| 106 | =============================================================================== |
| 107 | subcases.cpp(0): |
| 108 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
onqtam | 2e137ae | 2019-09-22 21:06:02 +0300 | [diff] [blame] | 109 | level zero |
| 110 | |
onqtam | 72bf24e | 2020-05-17 20:19:54 +0300 | [diff] [blame] | 111 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 112 | level zero |
| 113 | one |
| 114 | |
onqtam | 2e137ae | 2019-09-22 21:06:02 +0300 | [diff] [blame] | 115 | subcases.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) |
| 116 | |
| 117 | =============================================================================== |
| 118 | subcases.cpp(0): |
| 119 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
onqtam | b656d60 | 2019-03-18 18:33:00 +0200 | [diff] [blame] | 120 | |
onqtam | 72bf24e | 2020-05-17 20:19:54 +0300 | [diff] [blame] | 121 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 122 | level zero |
| 123 | one |
| 124 | |
onqtam | b656d60 | 2019-03-18 18:33:00 +0200 | [diff] [blame] | 125 | subcases.cpp(0): ERROR: test case THREW exception: failure... but the show must go on! |
| 126 | |
| 127 | =============================================================================== |
| 128 | subcases.cpp(0): |
| 129 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
| 130 | level zero |
| 131 | two |
| 132 | |
| 133 | subcases.cpp(0): ERROR: CHECK( false ) is NOT correct! |
| 134 | values: CHECK( false ) |
| 135 | |
| 136 | =============================================================================== |
| 137 | subcases.cpp(0): |
| 138 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
onqtam | 2e137ae | 2019-09-22 21:06:02 +0300 | [diff] [blame] | 139 | level zero |
| 140 | |
onqtam | 72bf24e | 2020-05-17 20:19:54 +0300 | [diff] [blame] | 141 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 142 | level zero |
| 143 | two |
| 144 | |
onqtam | 2e137ae | 2019-09-22 21:06:02 +0300 | [diff] [blame] | 145 | subcases.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) |
| 146 | |
| 147 | =============================================================================== |
| 148 | subcases.cpp(0): |
| 149 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
onqtam | b656d60 | 2019-03-18 18:33:00 +0200 | [diff] [blame] | 150 | |
onqtam | 72bf24e | 2020-05-17 20:19:54 +0300 | [diff] [blame] | 151 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 152 | level zero |
| 153 | two |
| 154 | |
onqtam | b656d60 | 2019-03-18 18:33:00 +0200 | [diff] [blame] | 155 | subcases.cpp(0): ERROR: test case THREW exception: failure... but the show must go on! |
| 156 | |
| 157 | =============================================================================== |
onqtam | 3375222 | 2020-02-24 18:35:42 +0200 | [diff] [blame] | 158 | subcases.cpp(0): |
| 159 | TEST CASE: subcases with changing names |
| 160 | outer 0 |
| 161 | inner 0 |
| 162 | |
| 163 | subcases.cpp(0): MESSAGE: msg! |
| 164 | |
| 165 | =============================================================================== |
| 166 | subcases.cpp(0): |
| 167 | TEST CASE: subcases with changing names |
| 168 | outer 0 |
| 169 | inner 1 |
| 170 | |
| 171 | subcases.cpp(0): MESSAGE: msg! |
| 172 | |
| 173 | =============================================================================== |
| 174 | subcases.cpp(0): |
| 175 | TEST CASE: subcases with changing names |
| 176 | outer 1 |
| 177 | inner 0 |
| 178 | |
| 179 | subcases.cpp(0): MESSAGE: msg! |
| 180 | |
| 181 | =============================================================================== |
| 182 | subcases.cpp(0): |
| 183 | TEST CASE: subcases with changing names |
| 184 | outer 1 |
| 185 | inner 1 |
| 186 | |
| 187 | subcases.cpp(0): MESSAGE: msg! |
| 188 | |
| 189 | =============================================================================== |
| 190 | subcases.cpp(0): |
| 191 | TEST CASE: subcases with changing names |
| 192 | separate |
| 193 | |
| 194 | subcases.cpp(0): MESSAGE: separate msg! |
| 195 | |
| 196 | =============================================================================== |
Nick Black | 74b8ac4 | 2020-09-06 13:01:26 -0400 | [diff] [blame] | 197 | [doctest] test cases: 7 | 3 passed | 4 failed | |
| 198 | [doctest] assertions: 25 | 19 passed | 6 failed | |
onqtam | 754f402 | 2017-05-06 20:07:49 +0300 | [diff] [blame] | 199 | [doctest] Status: FAILURE! |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 200 | Program code. |