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

test run is too random #25

Open
amastrobera opened this issue Apr 26, 2023 · 0 comments
Open

test run is too random #25

amastrobera opened this issue Apr 26, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@amastrobera
Copy link
Owner

In many cases tests fail, because of an approximation error. The numbers for each test are generated randomly with something like

int IMin = -10;
int IMax = 10;
var p0 = new Point3D(seed.Next(IMin, IMax), seed.Next(IMin, IMax), seed.Next(IMin, IMax));

The result is: many times 1-2 out of 100 test runs fail.
image
In the deail we see
image
And
image

What solutions we have ?

a) we could save a serialized set of data points, that we can manually modify, and load on each test

b) save the seed of a successful test run and re use it several times. Here is a post that talks about it and more about the constructor of Random

@amastrobera amastrobera added the good first issue Good for newcomers label Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant