From b8d7cbcdd25c43657e4097f42af20b8bf3725b4b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 23 Dec 2008 16:07:04 -0500 Subject: Fixed the Range test --- sigcore/test/TestRange.cpp | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'sigcore/test/TestRange.cpp') 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 . */ -// Sicvore includes -#include "../Range.h" +// Header include +#include "TestRange.h" // QtTest includes #include -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)); -- cgit