Permalink
Browse files

Added unittest for new Util::poissonPDF routine

  • Loading branch information...
jfostier committed Feb 8, 2016
1 parent da0fc75 commit 5a7a95e902229366d0bb2daff842afa3291b1b6a
Showing with 13 additions and 2 deletions.
  1. +3 −2 unittest/CMakeLists.txt
  2. +10 −0 unittest/utiltest.cpp
View
@@ -1,7 +1,8 @@
include_directories(gtest/include ../src)
add_executable(unittest alignmenttest.cpp scaffoldtest.cpp readfiletest.cpp
add_executable(unittest utiltest.cpp alignmenttest.cpp scaffoldtest.cpp readfiletest.cpp
nucleotidetest.cpp kmermdtest.cpp kmertest.cpp tstringtest.cpp
../src/tstring.cpp ../src/nucleotide.cpp ../src/kmeroverlap.cpp ../src/alignment.cpp)
../src/tstring.cpp ../src/nucleotide.cpp ../src/kmeroverlap.cpp ../src/alignment.cpp
../src/util.cpp)
target_link_libraries(unittest readfile gtest essaMEM
gtest_main ${ZLIB_LIBRARIES} ${GSL_LIBRARIES} pthread)
View
@@ -0,0 +1,10 @@
#include <gtest/gtest.h>
#include "util.h"
TEST(poissonPDF, poissonPDFTest)
{
EXPECT_DOUBLE_EQ(0.12511003572113349, Util::poissonPDF(10, 10));
EXPECT_DOUBLE_EQ(4.8646491820674864E-63, Util::poissonPDF(100, 10));
EXPECT_DOUBLE_EQ(0, Util::poissonPDF(1000, 10));
EXPECT_DOUBLE_EQ(0, Util::poissonPDF(10000, 10));
}

0 comments on commit 5a7a95e

Please sign in to comment.