-
Notifications
You must be signed in to change notification settings - Fork 481
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
Add randomly generated tests #306
base: main
Are you sure you want to change the base?
Conversation
Can you please verify one of the code length 15 examples by hand. Using a calculator with sufficient digit precision. |
@@ -23,4 +23,1010 @@ | |||
1,181,4,62H30000+ | |||
90,1,10,CFX3X2X2+X2 | |||
# Test non-precise latitude/longitude value | |||
1.2,3.4,10,6FH56C22+22 |
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.
We appreciate everything that you do.
I think I'm going to pause this for the moment. A higher priority is getting the CI tests working and then I may add more test cases. |
Lots of issues in the tests generated. There's lots of boundary points, so we're getting variations in codes due to floating point handling in different languages (even on the same hardware). The existing Java implementation seems to think that the minimum valid code length is 4 (spec says 2) (#667). I'm going to generate a set that encode, then we'll see what fails on e.g. M1 mac I guess. |
NB: Blocked by #667 |
Good notes Actually, only two floating point operation are required. It's a modulation (if needed) then multiplication. This approach is spelled out in your favorite PR. I could try this in the C implementation. Just because I'm guessing that is the canonical one since the test runs first. But if I'm going to work on an implementation, to be honest, I would want to get my hands dirty and do a rewrite or fix a few things while I'm working on it. |
This adds 1000 random tests with random amounts of decimal places and code lengths.