-
Notifications
You must be signed in to change notification settings - Fork 88
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
Merge in binary fields from libiop, make API consistent between fields, add tests, etc #44
Conversation
Also changed all tests to use Google test (gtest). It looks like I copied the whole gtest repo. It might have been better as a git submodule. |
It seems that the entire You can either remove it via an additional commit, or use things like |
GroupT two = bigint<1>(2l) * GroupT::one(); | ||
assert(two == two); | ||
EXPECT_EQ(two, two); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't the line above tautological? See: #38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I think I understand what @ValarDragon said on my PR. The one == one
is a way to test the operator==
, is that what you meant @ValarDragon?
I was expecting a separate test for that... i.e. having a test per function (with positive and negative test cases) instead of a test function (like this test_group
) testing a bunch of functions at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that is what I meant! Sorry I didn't reply to that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, thanks for confirming! I get your point, the asserts I removed in #38 are definitely not "dummy/tautological" asserts. They are test cases, so we need to keep them.
That being said, I find the current test structure quite confusing. There is a test_mixed_add()
function to test the mixed addition, a test_mul_by_q()
function to test mult by field characteristic, a test_output()
function for the operator>>
and operator<<
, and the rest of the functions of the "group interface" are tested in this test_group()
function. I find this quite inconsistent - i.e. some functions have their own tests (1 function - 1 associated test), some don't. Additionally, I am not sure that all functions from the group are actually tested here (I can't see any test for is_well_formed
for instance).
I personally tend to prefer over verbosity in tests as a way to make it trivial to see what is tested and what is not, and avoid mistakes.
If sticking to a single test test_group
is desired here, I think doing something like:
template<typename GroupT>
void test_group{
test_add<GroupT>(); // test add() function
test_is_well_formed<GroupT>(); // test is_well_formed()
test_dbl<GroupT>(); // test dbl()
test_equal<GroupT>(); // test operator==() (can also test operator!=() or do it in another fucntion)
...
test_is_zero<GroupT>();
test_mul_by_q<GroupT>();
}
Would be a good improvement, as we would test each function independently, and these tests would be self contained. This would avoid mixing all test cases in one big test function.
Any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, though I never touched this code other than using gtest. Since this seems to require a relatively large refactor, maybe save it for a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have opened a ticket for that, see: #46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a great change for readability to me as well
There seem to be a lot of files committed that are output from the build (binary files or files with cached settings which are machine specific). Primarily in |
I recommend switching to github actions, Travis acts up a lot and is much slower. |
…nd fix compile errors
I did a cherry pick to change gtest to a git submodule |
@Pratyush |
There seems to be rather a lot happening in this PR (and discussion). We might benefit from splitting into multiple PRs. One possible division would be:
|
I suggest the following structure for new , smaller/easier to review PR's to make these changes, and decouple things. Suggested sequence of PR's to staging: First have 1 PR to bring in the new field.hpp interface, which we can comment on, etc. Once that is merged, then the two following PR's (perhaps in parallel or sequence, whatever you prefer):
At any point, have the PR to switch to gtest. I don't know at what point that transition is easiest. (Also we could do a partial transition at first) @alexander-zw Let me know if you have time to split up the PR, or if you'd like help |
a062cd7
to
e04f2db
Compare
All changes in this PR were added in other PRs |
Note: some file directory structures were changed, which might affect code that uses this as a dependency.