summaryrefslogtreecommitdiffstats
path: root/sigcore/test/TestRange.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-12-23 16:07:04 -0500
committerBen Boeckel <MathStuf@gmail.com>2008-12-23 16:07:04 -0500
commitb8d7cbcdd25c43657e4097f42af20b8bf3725b4b (patch)
tree9be315f32cabd63202f189baa89eb9f4160bfe75 /sigcore/test/TestRange.cpp
parenteb2308b8035302b76f794e83b9cf5c5f4cff7a4c (diff)
downloadsigen-b8d7cbcdd25c43657e4097f42af20b8bf3725b4b.tar.gz
sigen-b8d7cbcdd25c43657e4097f42af20b8bf3725b4b.tar.xz
sigen-b8d7cbcdd25c43657e4097f42af20b8bf3725b4b.zip
Fixed the Range test
Diffstat (limited to 'sigcore/test/TestRange.cpp')
-rw-r--r--sigcore/test/TestRange.cpp28
1 files changed, 4 insertions, 24 deletions
diff --git a/sigcore/test/TestRange.cpp b/sigcore/test/TestRange.cpp
index 88e76c7a..1fc7a79c 100644
--- a/sigcore/test/TestRange.cpp
+++ b/sigcore/test/TestRange.cpp
@@ -15,32 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-// Sicvore includes
-#include "../Range.h"
+// Header include
+#include "TestRange.h"
// QtTest includes
#include <QtTest/QTest>
-class TestRange : public QObject
-{
- Q_OBJECT
-
- private slots:
- void set();
- void setMinimum();
- void setMaximum();
- void valid();
- void in();
- void intersection();
- void setUnion();
- void negation();
- void addition();
- void subtraction();
- void multiplication();
- void division();
- void equality();
-};
-
void TestRange::set()
{
Sigcore::Range range(4., 5.);
@@ -99,7 +79,7 @@ void TestRange::in()
QCOMPARE(range.in(3.), true);
QCOMPARE(range.in(6.), false);
- QCOMPARE(range.in(Sigcore::Range(4., 6.)), true);
+ QCOMPARE(range.in(Sigcore::Range(1., 2.)), true);
QCOMPARE(range.in(Sigcore::Range(4., 6.)), false);
}
@@ -156,7 +136,7 @@ void TestRange::division()
{
Sigcore::Range range(1., 3.);
- QCOMPARE(range / Sigcore::Range(2., 4.), Sigcore::Range(2., 12.));
+ QCOMPARE(range / Sigcore::Range(2., 4.), Sigcore::Range(1./4., 3./2.));
QCOMPARE((range / Sigcore::Range(-2., 4.)).valid(), false);
QCOMPARE(range / 2., Sigcore::Range(.5, 1.5));
QCOMPARE(range / -2., Sigcore::Range(-1.5, -.5));