Permalink
Browse files

add in tests for IndelQueueEntry

  • Loading branch information...
1 parent 9a2ab34 commit d9d6ba5e5bb782f982f3548157c25a625ff4435b @ernfrid ernfrid committed Dec 20, 2015
Showing with 35 additions and 2 deletions.
  1. +1 −0 test/lib/bamrc/CMakeLists.txt
  2. +0 −2 test/lib/bamrc/TestIndelQueue.cpp
  3. +34 −0 test/lib/bamrc/TestIndelQueueEntry.cpp
@@ -9,4 +9,5 @@ add_unit_tests(TestBamrcLib
TestAuxFields.cpp
TestReadWarnings.cpp
TestIndelQueue.cpp
+ TestIndelQueueEntry.cpp
)
@@ -7,8 +7,6 @@
#include <sstream>
#include <memory>
-std::auto_ptr<ReadWarnings> WARN;
-
using namespace std;
TEST(IndelQueue, push) {
@@ -0,0 +1,34 @@
+#include "bamrc/IndelQueueEntry.hpp"
+#include "bamrc/ReadWarnings.hpp"
+#include "bamrc/BasicStat.hpp"
+
+#include <gtest/gtest.h>
+
+#include <sstream>
+#include <memory>
+
+//FIXME This is required for all things in the test library
+//using the ReadWarnings class.
+std::auto_ptr<ReadWarnings> WARN;
+
+using namespace std;
+
+TEST(IndelQueueEntry, parameterized_constructor) {
+ BasicStat indel_stat(true);
+ IndelQueueEntry new_entry(1, 20, indel_stat, "-AA");
+ ASSERT_EQ(1, new_entry.tid);
+ ASSERT_EQ(20, new_entry.pos);
+ ASSERT_EQ("-AA", new_entry.allele);
+}
+
+TEST(IndelQueueEntry, stream_output) {
+ stringstream stat_stream;
+ stat_stream << "-AA:";
+ BasicStat indel_stat(true);
+ stat_stream << indel_stat;
+
+ stringstream entry_stream;
+ IndelQueueEntry new_entry(1, 20, indel_stat, "-AA");
+ entry_stream << new_entry;
+ ASSERT_EQ(stat_stream.str(), entry_stream.str());
+}

0 comments on commit d9d6ba5

Please sign in to comment.