From: Rico Tzschichholz Date: Thu, 21 Feb 2019 07:04:03 +0000 (+0100) Subject: tests: Add regression test for modulo operation on double and float X-Git-Tag: 0.36.18~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f4a430675d480aa20f798f2ed035c3bcd7a15e8;p=thirdparty%2Fvala.git tests: Add regression test for modulo operation on double and float https://bugzilla.gnome.org/show_bug.cgi?id=610660 --- diff --git a/tests/Makefile.am b/tests/Makefile.am index c6c78fb6b..707246aaf 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -31,6 +31,7 @@ TESTS = \ basic-types/bug595751.vala \ basic-types/bug596637.vala \ basic-types/bug596785.vala \ + basic-types/bug610660.vala \ basic-types/bug622178.vala \ basic-types/bug632322.vala \ basic-types/bug643612.vala \ diff --git a/tests/basic-types/bug610660.vala b/tests/basic-types/bug610660.vala new file mode 100644 index 000000000..88585e10a --- /dev/null +++ b/tests/basic-types/bug610660.vala @@ -0,0 +1,22 @@ +void main () { + { + double d = 42.0; + d = d % 42.0; + assert (d == 0.0); + } + { + double d = 23.0; + d %= 23.0; + assert (d == 0.0); + } + { + float f = 42.0f; + f = f % 42.0f; + assert (f == 0.0f); + } + { + float f = 23.0f; + f %= 23.0f; + assert (f == 0.0f); + } +}