Skip to content

Misc Test Improvements#1200

Merged
isuruf merged 1 commit intosymengine:masterfrom
ShikharJ:IncreaseCov
Feb 4, 2017
Merged

Misc Test Improvements#1200
isuruf merged 1 commit intosymengine:masterfrom
ShikharJ:IncreaseCov

Conversation

@ShikharJ
Copy link
Copy Markdown
Member

Please review and suggest improvements.

@isuruf
Copy link
Copy Markdown
Member

isuruf commented Jan 29, 2017

Thanks for the PR. Can you fix the merge conflicts?

@ShikharJ
Copy link
Copy Markdown
Member Author

Updated @isuruf.

CHECK(i2->compare(*i2) == 0);
CHECK(i2->compare(*i3) == -1);
CHECK(i3->compare(*i2) == 1);
REQUIRE(x->compare(*x) == 0);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? CHECK is actually better than REQUIRE, because even if a test fail, the rest of the tests will be run.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So can the rest of the cases be changed to CHECK?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should, but that's a big change and I would only change it for the future

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I'd like to take that up whenever it's relevant.


c1 = Complex::from_two_nums(*integer(2), *integer(5));
c2 = real_double(0.8);
CHECK_THROWS_AS(c1->rsub(*c2), NotImplementedError);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't call rsub directly. Use c1->sub(*c2).
subnum(c1, c2) is even better.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must have accidentally made that. I'll change it.

SYMENGINE_C_ASSERT(!is_a_Integer(e));

rational_set_si(e, 100, 47);
s = basic_str(e);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Value of s needs to be freed before assigning.

CHECK(is_a<Integer>(*r1));
CHECK(r1->__eq__(*integer(3)));
REQUIRE(is_a<Integer>(*r1));
REQUIRE(r1->__eq__(*integer(3)));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this back to the original?

Copy link
Copy Markdown
Member

@isuruf isuruf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this PR. +2% coverage is a lot.

@ShikharJ
Copy link
Copy Markdown
Member Author

ShikharJ commented Feb 1, 2017

Stay tuned. More is to come :)

@isuruf
Copy link
Copy Markdown
Member

isuruf commented Feb 2, 2017

@ShikarhJ, can you fix the merge conflicts?

@ShikharJ
Copy link
Copy Markdown
Member Author

ShikharJ commented Feb 2, 2017

Updated @isuruf

@isuruf isuruf merged commit 76dffa8 into symengine:master Feb 4, 2017
@ShikharJ ShikharJ deleted the IncreaseCov branch February 8, 2017 13:55
isuruf added a commit to isuruf/symengine that referenced this pull request Aug 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants