diff options
Diffstat (limited to '055shape_shifting_container.cc')
-rw-r--r-- | 055shape_shifting_container.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/055shape_shifting_container.cc b/055shape_shifting_container.cc index 60774926..4db3efaa 100644 --- a/055shape_shifting_container.cc +++ b/055shape_shifting_container.cc @@ -1,6 +1,7 @@ //:: Container definitions can contain 'type ingredients' :(scenario size_of_shape_shifting_container) +% cerr << "S1\n"; container foo:_t [ x:_t y:number @@ -16,6 +17,7 @@ def main [ +mem: storing 16 in location 5 :(scenario size_of_shape_shifting_container_2) +% cerr << "S2\n"; # multiple type ingredients container foo:_a:_b [ x:_a @@ -27,6 +29,7 @@ def main [ $error: 0 :(scenario size_of_shape_shifting_container_3) +% cerr << "S3\n"; container foo:_a:_b [ x:_a y:_b @@ -39,6 +42,7 @@ def main [ $error: 0 :(scenario size_of_shape_shifting_container_4) +% cerr << "S4\n"; container foo:_a:_b [ x:_a y:_b @@ -54,6 +58,7 @@ def main [ $error: 0 :(scenario shape_shifting_container_extend) +% cerr << "S5\n"; container foo:_a [ x:_a ] @@ -63,6 +68,7 @@ container foo:_a [ $error: 0 :(scenario shape_shifting_container_extend_error) +% cerr << "S6\n"; % Hide_errors = true; container foo:_a [ x:_a @@ -73,6 +79,7 @@ container foo:_b [ +error: headers of container 'foo' must use identical type ingredients :(scenario type_ingredient_must_start_with_underscore) +% cerr << "S7\n"; % Hide_errors = true; container foo:t [ x:number @@ -364,7 +371,9 @@ bool final_type_ingredient(int type_ingredient_index, const type_info& container return true; } +:(before "End Unit Tests") void test_replace_type_ingredients_entire() { + cerr << "U1\n"; run("container foo:_elem [\n" " x:_elem\n" " y:number\n" @@ -377,6 +386,7 @@ void test_replace_type_ingredients_entire() { } void test_replace_type_ingredients_tail() { + cerr << "U2\n"; run("container foo:_elem [\n" " x:_elem\n" "]\n" @@ -392,6 +402,7 @@ void test_replace_type_ingredients_tail() { } void test_replace_type_ingredients_head_tail_multiple() { + cerr << "U3\n"; run("container foo:_elem [\n" " x:_elem\n" "]\n" @@ -409,6 +420,7 @@ void test_replace_type_ingredients_head_tail_multiple() { } void test_replace_type_ingredients_head_middle() { + cerr << "U4\n"; run("container foo:_elem [\n" " x:_elem\n" "]\n" @@ -428,6 +440,7 @@ void test_replace_type_ingredients_head_middle() { } void test_replace_last_type_ingredient_with_multiple() { + cerr << "U5\n"; run("container foo:_a:_b [\n" " x:_a\n" " y:_b\n" @@ -446,6 +459,7 @@ void test_replace_last_type_ingredient_with_multiple() { } void test_replace_middle_type_ingredient_with_multiple() { + cerr << "U6\n"; run("container foo:_a:_b:_c [\n" " x:_a\n" " y:_b\n" @@ -469,6 +483,7 @@ void test_replace_middle_type_ingredient_with_multiple() { } void test_replace_middle_type_ingredient_with_multiple2() { + cerr << "U7\n"; run("container foo:_key:_value [\n" " key:_key\n" " value:_value\n" @@ -483,6 +498,7 @@ void test_replace_middle_type_ingredient_with_multiple2() { } void test_replace_middle_type_ingredient_with_multiple3() { + cerr << "U8\n"; run("container foo_table:_key:_value [\n" " data:address:array:foo_table_row:_key:_value\n" "]\n" @@ -505,6 +521,7 @@ void test_replace_middle_type_ingredient_with_multiple3() { CHECK(!element.type->right->right->right->right->right); } +:(code) bool has_nth_type(const type_tree* base, int n) { assert(n >= 0); if (!base) return false; |