From 55d010bad839b503cbfa759498d18690f4a809ae Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 17 Apr 2014 12:21:39 -0300 Subject: Moved code around to make possible to compile the C part alone. The C code should be compilable without the need to compile the Gui part, too. This is expecially good for unit testing as we can test all the algorithms without a window appearing out of nowhere. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- tests/testprofile.cpp | 9 +++++++++ tests/testprofile.h | 12 ++++++++++++ tests/testunitconversion.cpp | 1 + 3 files changed, 22 insertions(+) create mode 100644 tests/testprofile.cpp create mode 100644 tests/testprofile.h (limited to 'tests') diff --git a/tests/testprofile.cpp b/tests/testprofile.cpp new file mode 100644 index 000000000..d8aea3cae --- /dev/null +++ b/tests/testprofile.cpp @@ -0,0 +1,9 @@ +#include "testprofile.h" +#include "dive.h" + +void TestProfile::testRedCeiling() +{ + parse_file("../dives/deep.xml"); +} + +QTEST_MAIN(TestProfile) \ No newline at end of file diff --git a/tests/testprofile.h b/tests/testprofile.h new file mode 100644 index 000000000..25f094b1b --- /dev/null +++ b/tests/testprofile.h @@ -0,0 +1,12 @@ +#ifndef TESTPROFILE_H +#define TESTPROFILE_H + +#include + +class TestProfile : public QObject{ + Q_OBJECT +private slots: + void testRedCeiling(); +}; + +#endif diff --git a/tests/testunitconversion.cpp b/tests/testunitconversion.cpp index b4d04067f..3adf975c4 100644 --- a/tests/testunitconversion.cpp +++ b/tests/testunitconversion.cpp @@ -20,6 +20,7 @@ void TestUnitConversion::testUnitConversions() QCOMPARE(IS_FP_SAME(bar_to_atm(1.013), 1), true); QCOMPARE(IS_FP_SAME(mbar_to_atm(1013), 1), true); QCOMPARE(mbar_to_PSI(1013), (int)15); + get_units(); } QTEST_MAIN(TestUnitConversion) -- cgit v1.2.3-70-g09d2