]> 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>
Thu, 21 Feb 2019 07:38:42 +0000 (08:38 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=610660

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

index ef5fc1c72fac39c3426688347f8262ec95739b89..178b897dc459032836dd04e59b5ade1b5d9bcfb0 100644 (file)
@@ -41,6 +41,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/bug641308.test \
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);
+       }
+}