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

Marginal differences shouldn't fail the test (there should be an option for this - sometimes a marginal failure is important) #4

Open
phorn-NI opened this issue Sep 26, 2024 · 3 comments

Comments

@phorn-NI
Copy link

Caraya supports a margin of error when comparing floating point numbers (as 10.0 != 10.0 exactly)

I found a similar issue when generating png images and trying to compare them. The two attached images were generated by exactly the same configuration script and look identical, but not when you put them through a compare tool - however for my purposes they're close enough (its the ends of the error bars that are 1 or 2 pixels different).

Its not urgent as the work around is to compare the configuration script, which is generated from a list of parameters - and that's what I'm really trying test
Test error-bar override test error bar base json formatter approved
Test error-bar override test error bar base json formatter received

@phorn-NI phorn-NI changed the title M Marginal differences shouldn't fail the test (there should be an option for this - sometimes a marginal failure is important) Sep 26, 2024
@stagg54
Copy link
Collaborator

stagg54 commented Sep 26, 2024

Hmm... I imagine this is fixable, but it will require some research. There is probably a png compare tool out there that might work for something like this. Right now IIRC (without looking at the code) I'm pretty sure it's just checking the file hashes to see if they match. That would have to tolerance builtin. That comparison is overrideable though - for VI and CTL files, it uses the LVCompare function.

@phorn-NI
Copy link
Author

Interesting research project then 😄
As I said, it's not a big problem for my immediate use case - testing the generated json is robust and gives me the same info.

@stagg54
Copy link
Collaborator

stagg54 commented Sep 26, 2024

Yeah I did a very brief look. ImageMagick seems to have a compare tool. Not sure how well that would work.

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

No branches or pull requests

2 participants