summaryrefslogtreecommitdiffstats
path: root/sigcore
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-12-23 15:57:34 -0500
committerBen Boeckel <MathStuf@gmail.com>2008-12-23 15:57:34 -0500
commiteb2308b8035302b76f794e83b9cf5c5f4cff7a4c (patch)
treecbf651d5593b4d456c7b3880931787bdb0b153c0 /sigcore
parent0c516ea53898f35b81ad095abb6638aa41c78d63 (diff)
downloadsigen-eb2308b8035302b76f794e83b9cf5c5f4cff7a4c.tar.gz
sigen-eb2308b8035302b76f794e83b9cf5c5f4cff7a4c.tar.xz
sigen-eb2308b8035302b76f794e83b9cf5c5f4cff7a4c.zip
Reverted to using headers for tests again
Diffstat (limited to 'sigcore')
-rw-r--r--sigcore/test/CMakeLists.txt1
-rw-r--r--sigcore/test/TestFraction.cpp30
-rw-r--r--sigcore/test/TestFraction.h50
-rw-r--r--sigcore/test/TestHat.cpp18
-rw-r--r--sigcore/test/TestHat.h38
-rw-r--r--sigcore/test/TestMatrix.cpp29
-rw-r--r--sigcore/test/TestMatrix.h49
7 files changed, 144 insertions, 71 deletions
diff --git a/sigcore/test/CMakeLists.txt b/sigcore/test/CMakeLists.txt
index 7af37ba1..ebdfce3b 100644
--- a/sigcore/test/CMakeLists.txt
+++ b/sigcore/test/CMakeLists.txt
@@ -6,3 +6,4 @@ MAKE_TEST(Fraction libraries)
MAKE_TEST(Hat libraries)
MAKE_TEST(Matrix libraries)
MAKE_TEST(Range libraries)
+# MAKE_TEST(Script libraries)
diff --git a/sigcore/test/TestFraction.cpp b/sigcore/test/TestFraction.cpp
index dd8e8b81..ec6fab37 100644
--- a/sigcore/test/TestFraction.cpp
+++ b/sigcore/test/TestFraction.cpp
@@ -15,38 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-// Sigcore includes
-#include "../Fraction.h"
+// Header include
+#include "TestFraction.h"
// Qt includes
#include <QtTest/QTest>
-class TestFraction : public QObject
-{
- Q_OBJECT
-
- private slots:
- void set();
- void setNumerator();
- void setDenominator();
-
- void reduce();
-
- void assignment();
- void conversion();
- void addition();
- void subtraction();
- void multiplication();
- void division();
- void modulo();
-
- void equal();
- void less();
- void greater();
-
- void normalize();
-};
-
void TestFraction::set()
{
Sigcore::Fraction frac(1, 1);
diff --git a/sigcore/test/TestFraction.h b/sigcore/test/TestFraction.h
new file mode 100644
index 00000000..2eb720a1
--- /dev/null
+++ b/sigcore/test/TestFraction.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2008 Ben Boeckel <MathStuf@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TESTFRACTION
+#define TESTFRACTION
+
+// Sigcore includes
+#include "../Fraction.h"
+
+class TestFraction : public QObject
+{
+ Q_OBJECT
+
+ private slots:
+ void set();
+ void setNumerator();
+ void setDenominator();
+
+ void reduce();
+
+ void assignment();
+ void conversion();
+ void addition();
+ void subtraction();
+ void multiplication();
+ void division();
+ void modulo();
+
+ void equal();
+ void less();
+ void greater();
+
+ void normalize();
+};
+
+#endif
diff --git a/sigcore/test/TestHat.cpp b/sigcore/test/TestHat.cpp
index 78d39f25..215744a7 100644
--- a/sigcore/test/TestHat.cpp
+++ b/sigcore/test/TestHat.cpp
@@ -15,26 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-// Sigcore includes
-#include "../Hat.h"
+// Header include
+#include "TestHat.h"
// Qt includes
#include <QtTest/QTest>
-class TestHat : public QObject
-{
- Q_OBJECT
-
- private slots:
- void initTestCase();
- void pick();
- void take();
- void takeAndClear();
- void setCount();
- void add();
- void chance();
-};
-
void TestHat::initTestCase()
{
qsrand(QDateTime::currentDateTime().toTime_t());
diff --git a/sigcore/test/TestHat.h b/sigcore/test/TestHat.h
new file mode 100644
index 00000000..b54dc759
--- /dev/null
+++ b/sigcore/test/TestHat.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2008 Ben Boeckel <MathStuf@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TESTHAT
+#define TESTHAT
+
+// Sigcore includes
+#include "../Hat.h"
+
+class TestHat : public QObject
+{
+ Q_OBJECT
+
+ private slots:
+ void initTestCase();
+ void pick();
+ void take();
+ void takeAndClear();
+ void setCount();
+ void add();
+ void chance();
+};
+
+#endif
diff --git a/sigcore/test/TestMatrix.cpp b/sigcore/test/TestMatrix.cpp
index 908ae80b..53cf57ea 100644
--- a/sigcore/test/TestMatrix.cpp
+++ b/sigcore/test/TestMatrix.cpp
@@ -15,37 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-// Sigcore includes
-#include "../Matrix.h"
+// Header include
+#include "TestMatrix.h"
// Qt includes
#include <QtTest/QTest>
-class TestMatrix : public QObject
-{
- Q_OBJECT
-
- private slots:
- void addRow();
- void addColumn();
- void insertRow();
- void insertColumn();
- void deleteRow();
- void deleteColumn();
-
- void clear();
-
- void resize();
-
- void row();
- void column();
-
- void access();
-
- void assignment();
- void equal();
-};
-
void TestMatrix::addRow()
{
Sigcore::Matrix<int> mat;
diff --git a/sigcore/test/TestMatrix.h b/sigcore/test/TestMatrix.h
new file mode 100644
index 00000000..7d30d030
--- /dev/null
+++ b/sigcore/test/TestMatrix.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2008 Ben Boeckel <MathStuf@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TESTMATRIX
+#define TESTMATRIX
+
+// Sigcore includes
+#include "../Matrix.h"
+
+class TestMatrix : public QObject
+{
+ Q_OBJECT
+
+ private slots:
+ void addRow();
+ void addColumn();
+ void insertRow();
+ void insertColumn();
+ void deleteRow();
+ void deleteColumn();
+
+ void clear();
+
+ void resize();
+
+ void row();
+ void column();
+
+ void access();
+
+ void assignment();
+ void equal();
+};
+
+#endif