summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRALOVICH, Kristof <tade60@freemail.hu>2015-09-19 14:43:08 +0200
committerRALOVICH, Kristof <tade60@freemail.hu>2015-09-19 14:43:08 +0200
commitacd64a4dc31a2926f749ddceba4e47aeef54135e (patch)
treebc4c73769e404b12cfd160632bd1ef9bea5862a5
parent7a7fc48c949d120cfc8e7fae618e45ffabc1d90d (diff)
frame for replay testingtest-replay
-rw-r--r--src/tests/CMakeLists.txt11
-rw-r--r--src/tests/testReplay.cpp68
2 files changed, 79 insertions, 0 deletions
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 19f534c..0ae6085 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -37,6 +37,15 @@ TARGET_LINK_LIBRARIES(lq1
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
)
+ADD_EXECUTABLE(testReplay
+ testReplay.cpp
+)
+TARGET_LINK_LIBRARIES(testReplay
+ antpm
+ ${Boost_PROGRAM_OPTIONS_LIBRARY}
+ ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
+)
+
IF(VALGRIND_PROGRAM)
function(add_my_test name binary)
@@ -77,3 +86,5 @@ ADD_MY_TEST(testUsbmon2AntCount ../antpm-usbmon2ant --op count ${CMAKE_CURRENT
ADD_MY_TEST(testsm1 sm1)
ADD_MY_TEST(testlq1 lq1)
+
+ADD_MY_TEST(testReplay1 testReplay)
diff --git a/src/tests/testReplay.cpp b/src/tests/testReplay.cpp
new file mode 100644
index 0000000..666199a
--- /dev/null
+++ b/src/tests/testReplay.cpp
@@ -0,0 +1,68 @@
+// -*- mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; coding: utf-8-unix -*-
+// ***** BEGIN LICENSE BLOCK *****
+//////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2011-2014 RALOVICH, Kristóf //
+// //
+// 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. //
+// //
+//////////////////////////////////////////////////////////////////////////
+// ***** END LICENSE BLOCK *****
+
+#include "AntMessenger.hpp"
+#include "antdefs.hpp"
+#include "DeviceSettings.hpp"
+#include "FIT.hpp"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <functional>
+#include <algorithm>
+#include <vector>
+#include <string>
+#include <iostream>
+#include "common.hpp"
+#include <boost/thread/thread_time.hpp>
+#include <boost/foreach.hpp>
+
+#include <boost/filesystem.hpp>
+
+
+#define BOOST_TEST_MODULE Replay
+//#include <boost/test/included/unit_test.hpp>
+#include <boost/test/unit_test.hpp>
+
+using namespace std;
+using namespace antpm;
+namespace fs = boost::filesystem;
+
+namespace antpm
+{
+
+template<>
+Log*
+ClassInstantiator<Log>::instantiate()
+{
+ return new Log(NULL);
+}
+
+}
+
+
+BOOST_AUTO_TEST_CASE(replay_1)
+{
+ antpm::Log::instance()->addSink(std::cout);
+
+ LOG(LOG_INF) << "replay_1";
+
+ BOOST_CHECK(true);
+}
+