diff --git a/poincare/test/tree/blob_node.h b/poincare/test/tree/blob_node.h index 5d81a0315..132d6dca1 100644 --- a/poincare/test/tree/blob_node.h +++ b/poincare/test/tree/blob_node.h @@ -23,7 +23,7 @@ public: int data() { return m_data; } void setData(int data) { m_data = data; } virtual int numberOfChildren() const override { return 0; } - #if POINCARE_TREE_LOG +#if POINCARE_TREE_LOG virtual void logNodeName(std::ostream & stream) const override { stream << "Blob"; } diff --git a/poincare/test/tree/pair_node.h b/poincare/test/tree/pair_node.h index 0fe15b034..51f652719 100644 --- a/poincare/test/tree/pair_node.h +++ b/poincare/test/tree/pair_node.h @@ -32,8 +32,8 @@ public: class PairByReference : public TreeByReference { public: PairByReference(TreeByReference t1, TreeByReference t2) : TreeByReference(TreePool::sharedPool()->createTreeNode()) { - replaceChildAtIndexInPlace(0, t1); // TODO: Is that the correct way to do this? - replaceChildAtIndexInPlace(1, t2); // TODO: Is that the correct way to do this? + replaceChildAtIndexInPlace(0, t1); + replaceChildAtIndexInPlace(1, t2); } }; diff --git a/poincare/test/tree/tree_by_value.cpp b/poincare/test/tree/tree_by_value.cpp index bc17fe7fd..03b40a9bf 100644 --- a/poincare/test/tree/tree_by_value.cpp +++ b/poincare/test/tree/tree_by_value.cpp @@ -33,7 +33,7 @@ static void assert_pool_size(int i) { #endif } -QUIZ_CASE(tree_by_values_are_stored_in_pool) { +QUIZ_CASE(tree_by_values_are_discared_after_block) { assert_pool_size(0); { BlobByValue b(0); @@ -42,6 +42,23 @@ QUIZ_CASE(tree_by_values_are_stored_in_pool) { assert_pool_size(0); } +void make_temp_blob() { + BlobByValue b(5); +} +QUIZ_CASE(tree_by_values_are_discared_after_function_call) { + assert_pool_size(0); + make_temp_blob(); + assert_pool_size(0); +} + +QUIZ_CASE(tree_by_values_can_be_copied) { + assert_pool_size(0); + BlobByValue b(123); + assert_pool_size(1); + TreeByValue t = b; + assert_pool_size(2); +} + TreeByValue blob_with_data_3() { return BlobByValue(3); }