Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add randomly generated tests #306

wants to merge 4 commits into from

Conversation

drinckes
Copy link
Contributor

This adds 1000 random tests with random amounts of decimal places and code lengths.

@google google deleted a comment from PatsyClark Apr 27, 2019
@drinckes drinckes self-assigned this May 7, 2019
@fulldecent
Copy link
Contributor

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
Copy link

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.

@drinckes
Copy link
Contributor Author

drinckes commented Dec 6, 2024

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.

@fulldecent
Copy link
Contributor

@drinckes got it can you confirm that the testing on C & CPP is the right approach now?

#599

Or are further changes needed on those two implementations before we fix the other ones

@drinckes
Copy link
Contributor Author

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.

@drinckes
Copy link
Contributor Author

NB: Blocked by #667

@fulldecent
Copy link
Contributor

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.

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.

3 participants