diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-02-19 02:43:36 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-02-19 02:43:36 -0800 |
commit | f6c7b4155936e7c5485a14abcbb458d0c3bbd882 (patch) | |
tree | cdb73c56c6398f40076f55559ba4908320f742a9 /058shape_shifting_container.cc | |
parent | d4dea9bd5f2f80795bd1bf6871c73b863f0525a1 (diff) | |
download | mu-f6c7b4155936e7c5485a14abcbb458d0c3bbd882.tar.gz |
2680
Memory leaks fixed.
Diffstat (limited to '058shape_shifting_container.cc')
-rw-r--r-- | 058shape_shifting_container.cc | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/058shape_shifting_container.cc b/058shape_shifting_container.cc index 319f0381..05466e3d 100644 --- a/058shape_shifting_container.cc +++ b/058shape_shifting_container.cc @@ -396,17 +396,17 @@ void test_replace_last_type_ingredient_with_multiple() { " y:_b\n" "]\n"); reagent callsite("{f: (foo number (address shared array character))}"); - reagent element = element_type(callsite, 0); - CHECK_EQ(element.name, "x"); - CHECK_EQ(element.properties.at(0).second->value, "number"); - CHECK(!element.properties.at(0).second->right); - element = element_type(callsite, 1); - CHECK_EQ(element.name, "y"); - CHECK_EQ(element.properties.at(0).second->value, "address"); - CHECK_EQ(element.properties.at(0).second->right->value, "shared"); - CHECK_EQ(element.properties.at(0).second->right->right->value, "array"); - CHECK_EQ(element.properties.at(0).second->right->right->right->value, "character"); - CHECK(!element.properties.at(0).second->right->right->right->right); + reagent element1 = element_type(callsite, 0); + CHECK_EQ(element1.name, "x"); + CHECK_EQ(element1.properties.at(0).second->value, "number"); + CHECK(!element1.properties.at(0).second->right); + reagent element2 = element_type(callsite, 1); + CHECK_EQ(element2.name, "y"); + CHECK_EQ(element2.properties.at(0).second->value, "address"); + CHECK_EQ(element2.properties.at(0).second->right->value, "shared"); + CHECK_EQ(element2.properties.at(0).second->right->right->value, "array"); + CHECK_EQ(element2.properties.at(0).second->right->right->right->value, "character"); + CHECK(!element2.properties.at(0).second->right->right->right->right); } void test_replace_middle_type_ingredient_with_multiple() { @@ -416,21 +416,21 @@ void test_replace_middle_type_ingredient_with_multiple() { " z:_c\n" "]\n"); reagent callsite("{f: (foo number (address shared array character) boolean)}"); - reagent element = element_type(callsite, 0); - CHECK_EQ(element.name, "x"); - CHECK_EQ(element.properties.at(0).second->value, "number"); - CHECK(!element.properties.at(0).second->right); - element = element_type(callsite, 1); - CHECK_EQ(element.name, "y"); - CHECK_EQ(element.properties.at(0).second->value, "address"); - CHECK_EQ(element.properties.at(0).second->right->value, "shared"); - CHECK_EQ(element.properties.at(0).second->right->right->value, "array"); - CHECK_EQ(element.properties.at(0).second->right->right->right->value, "character"); - CHECK(!element.properties.at(0).second->right->right->right->right); - element = element_type(callsite, 2); - CHECK_EQ(element.name, "z"); - CHECK_EQ(element.properties.at(0).second->value, "boolean"); - CHECK(!element.properties.at(0).second->right); + reagent element1 = element_type(callsite, 0); + CHECK_EQ(element1.name, "x"); + CHECK_EQ(element1.properties.at(0).second->value, "number"); + CHECK(!element1.properties.at(0).second->right); + reagent element2 = element_type(callsite, 1); + CHECK_EQ(element2.name, "y"); + CHECK_EQ(element2.properties.at(0).second->value, "address"); + CHECK_EQ(element2.properties.at(0).second->right->value, "shared"); + CHECK_EQ(element2.properties.at(0).second->right->right->value, "array"); + CHECK_EQ(element2.properties.at(0).second->right->right->right->value, "character"); + CHECK(!element2.properties.at(0).second->right->right->right->right); + reagent element3 = element_type(callsite, 2); + CHECK_EQ(element3.name, "z"); + CHECK_EQ(element3.properties.at(0).second->value, "boolean"); + CHECK(!element3.properties.at(0).second->right); } bool has_nth_type(const type_tree* base, long long int n) { |