diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-05-28 15:11:09 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-05-28 15:11:09 +0200 |
commit | b05d468e78976cd72706e28992f0ed9584f601df (patch) | |
tree | 93c5914f27edb207e801f37dd795ce05b2dc40fd | |
parent | f7fab4e6888004f7c7302f3bf0b84b6bd4433ebf (diff) |
Fix multiplexer unittest
-rw-r--r-- | test/test_multiplexer.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/test/test_multiplexer.cc b/test/test_multiplexer.cc index 7eec468..8e79d37 100644 --- a/test/test_multiplexer.cc +++ b/test/test_multiplexer.cc @@ -26,17 +26,18 @@ */ #include <cppunit/extensions/HelperMacros.h> +#include <hugin.h> + #include "../src/multiplexer.cc" #include "../src/multicast.cc" #include "../src/frame.cc" #include "../src/miav_config.cc" #include "../src/file.cc" -#include "../src/info_console.cc" -#include "../src/info.cc" #include "../src/threadsafe_queue_priority.cc" #include "../src/mutex.cc" #include "../src/semaphore.cc" #include "../src/util.cc" +#include "../hugin/hugin.c" // Class used to set config variables from string. class MiavConfigString : public MiavConfig { @@ -48,7 +49,7 @@ public: class StringFile : public File { public: - StringFile(Info *info) : File(info) {} + StringFile() {} int Write(void* data, int size) { str.append((const char*)data, (size_t)size); return size; @@ -102,10 +103,10 @@ std::string bin2str(uint8_t i) class MultiplexerTest : public Multiplexer { public: - MultiplexerTest(File *f, Multicast *m, Info *i, volatile bool *r, + MultiplexerTest(File *f, Multicast *m, volatile bool *r, ThreadSafeQueuePriority *video_q, ThreadSafeQueuePriority *audio_q) - : Multiplexer(f, m, i, r, video_q, audio_q) {} + : Multiplexer(f, m, r, video_q, audio_q) {} void system_header() { Multiplexer::system_header(); } void pack_header(uint32_t SCR) { Multiplexer::SCR = SCR; Multiplexer::pack_header(); @@ -124,7 +125,6 @@ class test_multiplexer : public CppUnit::TestFixture CPPUNIT_TEST_SUITE_END(); public: - InfoConsole *info; MiavConfigString *cfg; volatile bool r; @@ -134,12 +134,10 @@ public: "server_trash=\"\"\n" "server_later=\"\"\n"); config = cfg; // Global. Declared as extern in miav_config.h - info = new InfoConsole(cfg); } void tearDown() { delete cfg; - delete info; } void test_SCR() { @@ -188,8 +186,8 @@ public: } void test_pack() { - StringFile file(info); - MultiplexerTest mp(&file, NULL, info, &r, NULL, NULL); + StringFile file; + MultiplexerTest mp(&file, NULL, &r, NULL, NULL); mp.pack_header(0xD2345678); printf("pack_header:\n "); @@ -238,8 +236,8 @@ public: } void test_system_header() { - StringFile file(info); - MultiplexerTest mp(&file, NULL, info, &r, NULL, NULL); + StringFile file; + MultiplexerTest mp(&file, NULL, &r, NULL, NULL); mp.system_header(); printf("system_header:\n "); |