mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 22:30:30 +01:00
[poincare/test] Fix some pool size assertions
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user