]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add regression test for modulo operation on double and float
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 21 Feb 2019 07:04:03 +0000 (08:04 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 26 Feb 2019 16:53:41 +0000 (17:53 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=610660

tests/Makefile.am
tests/basic-types/bug610660.vala [new file with mode: 0644]

index e5489adb832e55f1f4d2b8a07eb8092199ac1791..fd7e22297bb653d221c366ca2d12414c8f2cd06e 100644 (file)
@@ -40,6 +40,7 @@ TESTS = \
        basic-types/bug596785.vala \
        basic-types/bug604371.vala \
        basic-types/bug604589.test \
+       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 (file)
index 0000000..88585e1
--- /dev/null
@@ -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);
+       }
+}