-
Notifications
You must be signed in to change notification settings - Fork 26
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
Added >, <, <=, >= operators along with tests #48
Conversation
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.
please don't use .txt
files for the purpose of testing of these operators. write direct assert statements in the .cpp
file itself.
use of .txt
file seems reasonable for stream operators but not for these operators.
I highly suggest to use text file for input to the tester as it makes it easier to generate test cases, makes writing the code much easier and also make the test data expandable. Since the constructors and stream operators are already tested, embedding the test cases in the tester doesn't provide any advantage. To make the codebase look cleaner, I can move all the input files into a separate folder |
if generation of test case is a matter then we can use some pseudo random number generator to generate random inputs over a range, this is much more easier and it also takes care of most of the possible test cases. Using text files for testing is not recommended generally. |
But pseudorandom number generation method is not feasible here as we don't know what should be the correct output for those randomly generated numbers. This is why I've used python to generate test cases as it supports operations over large integers |
I've updated the tester to use automated test case generator using random integers. This was indeed useful as it helped me find some cases where the code failed. I've made the required changes. |
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.
another good practice is to use ++i
instead of i++
, prefix operators are a bit more optimised.
@yashsoni501 soon we will have doxygen setup to auto generate the documentation for this library. Therefore i will be nice if you include proper documentation for each and everything along with illustrated examples in accordance with doxygen guidelines |
Here is an overview of what got changed by this pull request: Clones added
============
- tests/operators/greater_equal_test.cpp 1
- tests/operators/less_than_test.cpp 1
- tests/operators/less_equal_test.cpp 1
- tests/operators/greater_than_test.cpp 1
See the complete overview on Codacy |
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.
Needs improvement in further PR's.
Approving and Merging just in order to to enable some basic functional units for further development
Description of Change
Feature add
Operator overloads for >, <, <=, >= are added for largeInt datatype. Test cases randomly generated using python along with some handwritten test cases are also added
Checklist