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

update floating point comparison tests #304

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

atomczak
Copy link
Contributor

removed attribute and property tests using fixed 1e6 tolerance, replaced with relative precision (according to #294 and #78)

removed attribute and property tests using fixed 1e6 tolerance, replaced with relative precision (according to #294)
@atomczak atomczak added the tests label May 24, 2024
@atomczak atomczak added this to the 1.0 milestone May 24, 2024
@atomczak atomczak requested a review from CBenghi May 24, 2024 12:45
remove omitted tests with a fixed tolerance
@atomczak
Copy link
Contributor Author

For easier checking, here is the list of tests that were added:

value == 100000
	fail 99999.8999989
	pass 99999.899999
	pass 100000.100001
	fail 100000.1000011	

value == 1
	fail 0.9999979
	pass 0.999998
	pass 1.000002
	fail 1.0000021

value == 0.0000001
	fail -0.00000090000011
	pass -0.0000009000001
	pass 0.0000011000001
	fail 0.00000110000011

value == 0
	fail -0.0000011
	pass -0.000001
	pass 0.000001
	fail 0.0000011

value == -0.0000001
	fail -0.00000110000011
	pass -0.0000011000001
	pass 0.0000009000001
	fail 0.00000090000011

value == -1.0
	fail -1.00000200001
	pass -1.0000020000
	pass -0.999998
	fail -0.9999979

value == -1000000.0
	fail -1000001.00000100001
	pass -1000001.0000010000
	pass -999998.999999
	fail -999998.9999989

value > 0
	fail 0.0000009
	pass 0.000001

value >= 0
	fail -0.0000011
	pass -0.000001

value < 0
	fail -0.0000009
	pass -0.000001

value <= 0
	fail 0.0000011
	pass 0.000001

All 36 tests are based on Property, none on Attribute facet. I thought it's unnecessary to duplicate, but if you think we need both, I can add another 36 tests just on Attributes.

@berlotti berlotti merged commit dc8fcd2 into development Jun 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testcase "[PASS] Floating point numbers are compared with a 1e-6 tolerance 1-4/4"
2 participants