From 4a18e61d910c2828d186793c42f4e709205c36a5 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 10 Mar 2013 18:55:06 +0100 Subject: [PATCH] Add non reg test for bug 12373: pmodulo(n,m<0) returned a negative result. Change-Id: I3e31205eedbd72109add181f5035fe268d972b12 --- .../tests/nonreg_tests/bug_12373.dia.ref | 21 ++++++++++++++++++ .../tests/nonreg_tests/bug_12373.tst | 23 ++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 scilab/modules/elementary_functions/tests/nonreg_tests/bug_12373.dia.ref create mode 100644 scilab/modules/elementary_functions/tests/nonreg_tests/bug_12373.tst diff --git a/scilab/modules/elementary_functions/tests/nonreg_tests/bug_12373.dia.ref b/scilab/modules/elementary_functions/tests/nonreg_tests/bug_12373.dia.ref new file mode 100644 index 0000000..a2653c4 --- /dev/null +++ b/scilab/modules/elementary_functions/tests/nonreg_tests/bug_12373.dia.ref @@ -0,0 +1,21 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2012 - Scilab Enterprises - Sylvestre Ledru +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// +// <-- CLI SHELL MODE --> +// +// <-- Non-regression test for bug 12373 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/show_bug.cgi?id=12373 +// +// <-- Short Description --> +// pmodulo(n,m<0) returned a negative result +// +assert_checkequal(pmodulo(10,-6), 4); +assert_checkequal(pmodulo(-10,-6), 2); +assert_checkfalse(pmodulo(10,-6) == -2); +assert_checkfalse(pmodulo(-10,-6) == -4); diff --git a/scilab/modules/elementary_functions/tests/nonreg_tests/bug_12373.tst b/scilab/modules/elementary_functions/tests/nonreg_tests/bug_12373.tst new file mode 100644 index 0000000..7ce4242 --- /dev/null +++ b/scilab/modules/elementary_functions/tests/nonreg_tests/bug_12373.tst @@ -0,0 +1,23 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2012 - Scilab Enterprises - Sylvestre Ledru +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// +// <-- CLI SHELL MODE --> +// +// <-- Non-regression test for bug 12373 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/show_bug.cgi?id=12373 +// +// <-- Short Description --> +// pmodulo(n,m<0) returned a negative result +// + +assert_checkequal(pmodulo(10,-6), 4); +assert_checkequal(pmodulo(-10,-6), 2); + +assert_checkfalse(pmodulo(10,-6) == -2); +assert_checkfalse(pmodulo(-10,-6) == -4); \ No newline at end of file -- 1.7.9.5