Go to the source code of this file.
|
| SCENARIO ("vectors can be sized and resized", "[vector]") |
|
◆ SCENARIO()
SCENARIO |
( |
"vectors can be sized and resized" | , |
|
|
"" | [vector] ) |
Definition at line 7 of file 120-Bdd-ScenarioGivenWhenThen.cpp.
7 {
8
9 GIVEN(
"A vector with some items" ) {
10 std::vector<int> v( 5 );
11
14
15 WHEN(
"the size is increased" ) {
16 v.resize( 10 );
17
18 THEN(
"the size and capacity change" ) {
21 }
22 }
23 WHEN(
"the size is reduced" ) {
24 v.resize( 0 );
25
26 THEN(
"the size changes but not capacity" ) {
29 }
30 }
31 WHEN(
"more capacity is reserved" ) {
32 v.reserve( 10 );
33
34 THEN(
"the capacity changes but not the size" ) {
37 }
38 }
39 WHEN(
"less capacity is reserved" ) {
40 v.reserve( 0 );
41
42 THEN(
"neither size nor capacity are changed" ) {
45 }
46 }
47 }
48}