[vala/0.40] tests: Add regression test for modulo operation on double and float
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.40] tests: Add regression test for modulo operation on double and float
- Date: Thu, 28 Feb 2019 15:25:12 +0000 (UTC)
commit 03fc5793020c438c302bdd640ed03a9aab4159a3
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Feb 21 08:04:03 2019 +0100
tests: Add regression test for modulo operation on double and float
https://bugzilla.gnome.org/show_bug.cgi?id=610660
tests/Makefile.am | 1 +
tests/basic-types/bug610660.vala | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 92a57a540..764758955 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -35,6 +35,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
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);
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]