TestPileup.cpp

00001 /*
00002  *  Copyright (C) 2011  Regents of the University of Michigan
00003  *
00004  *   This program is free software: you can redistribute it and/or modify
00005  *   it under the terms of the GNU General Public License as published by
00006  *   the Free Software Foundation, either version 3 of the License, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU General Public License
00015  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
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 }
Generated on Tue Aug 23 18:19:04 2011 for libStatGen Software by  doxygen 1.6.3