TestPileup.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "TestPileup.h"
00018
00019 void testPileup()
00020 {
00021 TestPileup pileupTest;
00022 pileupTest.testPileupPosition();
00023 }
00024
00025 void TestPileupElement::analyze()
00026 {
00027 assert(strcmp(getChromosome(), "") == 0);
00028 assert(getRefPosition() == 14000);
00029 }
00030
00031
00032 void TestPileup::testPileupPosition()
00033 {
00034 assert(pileupPosition(14000) == 0);
00035 assert(pileupHead == 14000);
00036 assert(pileupStart == 14000);
00037 assert(pileupTail == 14000);
00038
00039 bool caught = false;
00040 try
00041 {
00042 pileupPosition(13999);
00043 }
00044 catch(std::exception& e)
00045 {
00046 caught = true;
00047 assert(strcmp(e.what(), "Overflow on the pileup buffer: specifiedPosition = 13999, pileup buffer start position: 14000, pileup buffer end position: 15024") == 0);
00048 }
00049 assert(caught);
00050
00051 caught = false;
00052 try
00053 {
00054 pileupPosition(15025);
00055 }
00056 catch(std::exception& e)
00057 {
00058 caught = true;
00059 assert(strcmp(e.what(), "Overflow on the pileup buffer: specifiedPosition = 15025, pileup buffer start position: 14000, pileup buffer end position: 15024") == 0);
00060 }
00061 assert(caught);
00062 }