Skip to content

Commit d4ce0bc

Browse files
benneybenney
authored andcommitted
add tests for stats
1 parent b63a56e commit d4ce0bc

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ set(
7373
test/globals.cpp
7474
test/polyx_test.cpp
7575
test/sequence_test.cpp
76+
test/stats_test.cpp
7677
)
7778
include_directories(
7879
# intel mac install location

test/stats_test.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <gtest/gtest.h>
2+
#include "../src/stats.h"
3+
#include "../src/evaluator.h"
4+
#include <algorithm>
5+
6+
TEST(StatsTests, summarise) {
7+
Read* left = new Read(
8+
new string("@NS500713:64:HFKJJBGXY:1:11101:20469:1097 1:N:0:TATAGCCT+GGTCCCGA"),
9+
new string("TTTTTTCTCTTGGACTCTAACACTGTTTTTTCTTATGAAAACACAGGAGTGATGACTAGTTGAGTGCATTCTTATGAGACTCATAGTCATTCTATGATGTAG"),
10+
new string("+"),
11+
new string("AAAAA6EEEEEEEEEEEEEEEEE#EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"));
12+
13+
Options* options = new Options();
14+
Stats stats(options);
15+
stats.statRead(left);
16+
stats.summarize();
17+
EXPECT_EQ(stats.getCycles(), 102);
18+
EXPECT_EQ(stats.getBases(), 102);
19+
EXPECT_EQ(stats.getReads(), 1);
20+
EXPECT_EQ(stats.getQ20(), 101);
21+
EXPECT_EQ(stats.getQ30(), 100);
22+
EXPECT_EQ(stats.getGCNumber(), 35);
23+
}

0 commit comments

Comments
 (0)