Skip to content

Commit

Permalink
add tests for stats
Browse files Browse the repository at this point in the history
  • Loading branch information
benney authored and benney committed Dec 18, 2024
1 parent b63a56e commit d4ce0bc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ set(
test/globals.cpp
test/polyx_test.cpp
test/sequence_test.cpp
test/stats_test.cpp
)
include_directories(
# intel mac install location
Expand Down
23 changes: 23 additions & 0 deletions test/stats_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <gtest/gtest.h>
#include "../src/stats.h"
#include "../src/evaluator.h"
#include <algorithm>

TEST(StatsTests, summarise) {
Read* left = new Read(
new string("@NS500713:64:HFKJJBGXY:1:11101:20469:1097 1:N:0:TATAGCCT+GGTCCCGA"),
new string("TTTTTTCTCTTGGACTCTAACACTGTTTTTTCTTATGAAAACACAGGAGTGATGACTAGTTGAGTGCATTCTTATGAGACTCATAGTCATTCTATGATGTAG"),
new string("+"),
new string("AAAAA6EEEEEEEEEEEEEEEEE#EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"));

Options* options = new Options();
Stats stats(options);
stats.statRead(left);
stats.summarize();
EXPECT_EQ(stats.getCycles(), 102);
EXPECT_EQ(stats.getBases(), 102);
EXPECT_EQ(stats.getReads(), 1);
EXPECT_EQ(stats.getQ20(), 101);
EXPECT_EQ(stats.getQ30(), 100);
EXPECT_EQ(stats.getGCNumber(), 35);
}

0 comments on commit d4ce0bc

Please sign in to comment.