Skip to content

Move big-int unit test to unit/ folder and make it a CATCH-style test [blocks: #2452] #3409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

tautschnig
Copy link
Collaborator

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

return x.scan(input.c_str(), base) == input.c_str() + input.size();
}

SCENARIO("arbitrary precision integers", "[core][big-int][bigint]")
Copy link
Contributor

Choose a reason for hiding this comment

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

Given these aren't really given/when/then style tests you might want to just use the TEST_CASE header (see https://github.com/catchorg/Catch2/blob/master/docs/tutorial.md#test-cases-and-sections)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks a lot for the guidance, done as suggested.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: e7b6291).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/91342365

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 17d96d7).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/91358749

@peterschrammel
Copy link
Member

@tautschnig, any reason for not merging this?

@tautschnig
Copy link
Collaborator Author

Missing approval from @kroening ?

@kroening
Copy link
Member

This is problematic -- note that the big-int code has a different license. While the tests don't end up in the executable, I am still concerned.

@tautschnig
Copy link
Collaborator Author

This is problematic -- note that the big-int code has a different license. While the tests don't end up in the executable, I am still concerned.

I don't completely follow: the big-int code always ends up in the binary, so the test wouldn't affect this in any way.

@kroening
Copy link
Member

As of now, our approach to documenting which code has which license is much "per directory" -- moving the big-int test code to the unit tests means that the code in there has different licenses. That can be done, but needs clear documenting.

@tautschnig
Copy link
Collaborator Author

As of now, our approach to documenting which code has which license is much "per directory" -- moving the big-int test code to the unit tests means that the code in there has different licenses. That can be done, but needs clear documenting.

I'm all for proper documentation, we've had this question come up a few times. Any proposals for how you'd like to have it documented? AFAIK we don't actually have an explicit documentation at the moment and is-in-a-separate-directory is already the case as the moved code lives in unit/big-int/. I'm biased, but I'd lean towards https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/.

@kroening
Copy link
Member

Yes, I also like that particular machine-readable format!

@kroening kroening assigned tautschnig and unassigned kroening Dec 11, 2018
@tautschnig tautschnig merged commit 28935e6 into diffblue:develop Dec 19, 2018
@tautschnig tautschnig deleted the big-int-unit-test branch December 19, 2018 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants