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 TestPileup::testPileupPosition()
00026 {
00027 assert(pileupPosition(14000) == 0);
00028 assert(pileupHead == 14000);
00029 assert(pileupStart == 14000);
00030 assert(pileupTail == 14000);
00031
00032 bool caught = false;
00033 try
00034 {
00035 pileupPosition(13999);
00036 }
00037 catch(std::exception& e)
00038 {
00039 caught = true;
00040 assert(strcmp(e.what(), "Overflow on the pileup buffer: specifiedPosition = 13999, pileup buffer start position: 14000, pileup buffer end position: 15024") == 0);
00041 }
00042 assert(caught);
00043
00044 caught = false;
00045 try
00046 {
00047 pileupPosition(15025);
00048 }
00049 catch(std::exception& e)
00050 {
00051 caught = true;
00052 assert(strcmp(e.what(), "Overflow on the pileup buffer: specifiedPosition = 15025, pileup buffer start position: 14000, pileup buffer end position: 15024") == 0);
00053 }
00054 assert(caught);
00055 }