diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-04-14 14:27:32 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-04-14 11:49:49 -0700 |
commit | 019edd065fd1eefd5f705c42bce23255bb5e20ac (patch) | |
tree | 7152ff352630d4eeab654f6c2e7307fb1e982cb3 /tests | |
parent | 907d8b8fbbb0bc07ccc4c4b4d1374f764c5d8dae (diff) | |
download | subsurface-019edd065fd1eefd5f705c42bce23255bb5e20ac.tar.gz |
First test case implemented.
This is just a stub test case to show how a test case should be
implemented. every 'private slot' on the test classes will be
automatically executed when you run 'make test' on the terminal,
and a report will be generated with a failure / success.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testunitconversion.cpp | 14 | ||||
-rw-r--r-- | tests/testunitconversion.h | 12 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/testunitconversion.cpp b/tests/testunitconversion.cpp new file mode 100644 index 000000000..54b7e1b7b --- /dev/null +++ b/tests/testunitconversion.cpp @@ -0,0 +1,14 @@ +#include "testunitconversion.h" +#include "dive.h" + +void TestUnitConversion::testUnitConversions() +{ + QCOMPARE(IS_FP_SAME(grams_to_lbs(1000), 2.20459), true); + QCOMPARE(lbs_to_grams(1), 454); + QCOMPARE(IS_FP_SAME(ml_to_cuft(1000), 0.0353147), true); + QCOMPARE(IS_FP_SAME(cuft_to_l(1), 28.3168), true); + QCOMPARE(IS_FP_SAME(mm_to_feet(1000), 3.28084), true); + QCOMPARE(feet_to_mm(1), (long unsigned int) 305); +} + +QTEST_MAIN(TestUnitConversion)
\ No newline at end of file diff --git a/tests/testunitconversion.h b/tests/testunitconversion.h new file mode 100644 index 000000000..b8f05858a --- /dev/null +++ b/tests/testunitconversion.h @@ -0,0 +1,12 @@ +#ifndef TESTUNITCONVERSION_H +#define TESTUNITCONVERSION_H + +#include <QtTest> + +class TestUnitConversion : public QObject{ + Q_OBJECT +private slots: + void testUnitConversions(); +}; + +#endif
\ No newline at end of file |