[poincare/test] Fix some pool size assertions

This commit is contained in:
Léa Saviot
2018-08-20 17:06:08 +02:00
parent ed3018dc74
commit 1509fe8bda
3 changed files with 6 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ static inline Integer MaxInteger() { return Integer(MaxIntegerString); }
static inline Integer OverflowedInteger() { return Integer(OverflowedIntegerString); }
QUIZ_CASE(poincare_integer_constructor) {
int initialPoolSize = pool_size();
Integer staticZero;
Integer a("123");
Integer na("-123");
@@ -21,7 +22,7 @@ QUIZ_CASE(poincare_integer_constructor) {
Integer d((int64_t)1234567891011121314);
Integer nd((int64_t)(-1234567891011121314));
Integer e = Integer::Overflow();
assert_pool_size(9);
assert_pool_size(initialPoolSize+9);
}
static inline void assert_equal(const Integer i, const Integer j) {

View File

@@ -9,9 +9,9 @@
using namespace Poincare;
QUIZ_CASE(poincare_parser) {
assert_pool_size(0);
int initialPoolSize = pool_size();
assert_parsed_expression_type("2+3", ExpressionNode::Type::Addition);
assert_pool_size(0);
assert_pool_size(initialPoolSize);
#if 0
assert_parsed_expression_evaluates_to<float>("-2-3", "-5");
assert_parsed_expression_evaluates_to<float>("1.2*X^(1)", "3.261938");

View File

@@ -7,13 +7,14 @@
using namespace Poincare;
QUIZ_CASE(poincare_rational_constructor) {
int initialPoolSize = pool_size();
Rational a(Integer("123"), Integer("324"));
Rational b(Integer("3456"));
Rational c(123,324);
Rational d(3456789);
Rational e(Integer::Overflow());
Rational f(Integer::Overflow(), Integer::Overflow());
assert_pool_size(6);
assert_pool_size(initialPoolSize+6);
}
static inline void assert_equal(const Rational i, const Rational j) {