ytnobody / Vector-QRCode-EPS

A generator class for vector data of QRCode
Other
2 stars 0 forks source link

Fails on nvsize!=8 #2

Closed andk closed 10 years ago

andk commented 10 years ago

As per subject. Compiling with -Duselongdouble on a 64 bit system should trigger that.

Sample fail report:

http://www.cpantesters.org/cpan/report/43645932

HTH&&Thanks, (Disclaimer: this was discovered by statistical analysis, I'm not speaking as a user)

ytnobody commented 10 years ago

I want any idea for resolve this issue...

I have following ideas. But, these is evil.

  1. REMOVE or SKIP THIS TEST!!!! (EVIL!!!!)
  2. Add expected data for nvSize=16. (Other nvSize? :cry:)
  3. Accept little error. (Poor. And feel lazy for parsing ESP data.)

Anyway, I want to fix this issue in few days.

andk commented 10 years ago

I'd recommend (3) because it's a reflection of what floating point numbers are. It's not poor. There is a nice module made for that: Test::Number::Delta

ytnobody commented 10 years ago

@andk Thank you for recommendation! I'm going to try. :grin:

ytnobody commented 10 years ago

http://www.cpantesters.org/cpan/report/91961fa6-1bed-11e4-860f-dbe3c7ccabfc

I did a mistake specifying an epsilon value. :cry:

https://github.com/ytnobody/Vector-QRCode-EPS/blob/master/t/11_generate.t#L44

        delta_within(
            \@res_cell_def, \@exp_cell_def, 1e-15, 
            sprintf("compare: \n==RES==\n%s\n==EXPECT==\n%s\n", $res_qr_cell[$i], $exp_qr_cell[$i])
        );

I think, 1e-12 is good value as range specification value.

andk commented 10 years ago

On Mon, 04 Aug 2014 19:58:11 -0700, ytnobody notifications@github.com said:

I think, 1e-12 is good value as range specification value.

I tried the t/11_generate.t with 1e-12, 1e-13, and 1e-14 and all passed the tests with nvsize=16.

andreas

ytnobody commented 10 years ago

http://www.cpantesters.org/cpan/report/45ffbfbc-1c78-11e4-bc46-ebddc7ccabfc

Fixed in 0.07. Thank you, @andk !!! :smile: