From 4b4947636b878a9a71dad9ace98e15916dbe9dbc Mon Sep 17 00:00:00 2001 From: philipp schoenberger Date: Tue, 23 Jun 2015 14:01:41 +0200 Subject: [PATCH] add first test code --- lwrserv/test/main.cpp | 16 ++++++++ lwrserv/test/test_mat.cpp | 83 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 lwrserv/test/main.cpp create mode 100644 lwrserv/test/test_mat.cpp diff --git a/lwrserv/test/main.cpp b/lwrserv/test/main.cpp new file mode 100644 index 0000000..68e7da8 --- /dev/null +++ b/lwrserv/test/main.cpp @@ -0,0 +1,16 @@ +#ifdef UNIT_TEST + +#include "CppUTest/CommandLineTestRunner.h" +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/TestTestingFixture.h" +#include "CppUTest/PlatformSpecificFunctions.h" + + + +int main(int ac, char** av) +{ + return CommandLineTestRunner::RunAllTests(ac, av); +} + +#endif diff --git a/lwrserv/test/test_mat.cpp b/lwrserv/test/test_mat.cpp new file mode 100644 index 0000000..123198d --- /dev/null +++ b/lwrserv/test/test_mat.cpp @@ -0,0 +1,83 @@ +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestRegistry.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/TestTestingFixture.h" + +#include "mat.h" + +#define TESTSIZE 4 + +TEST_GROUP(Matrix) +{ + void setup() + { + } + + void teardown() + { + } +}; +TEST(Matrix, set) +{ + Mat a ; + Mat b ; + + for (int x = 0; x a ; + + for (int x = 0; x a ; + for (int x = 0; x