TestSamRecordHelper.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "TestSamRecordHelper.h"
00019 #include "TestValidate.h"
00020 #include "SamRecordHelper.h"
00021 #include <assert.h>
00022
00023 void testSamRecordHelper()
00024 {
00025
00026 SamRecordHelperTest::testSamRecordHelper("testFiles/testSam.sam");
00027
00028 }
00029
00030
00031 void SamRecordHelperTest::testSamRecordHelper(const char* fileName)
00032 {
00033 SamFile inSam;
00034 assert(inSam.OpenForRead(fileName));
00035 SamFileHeader samHeader;
00036 assert(inSam.ReadHeader(samHeader));
00037 validateHeader(samHeader);
00038
00039 SamRecord samRecord;
00040 assert(inSam.ReadRecord(samHeader, samRecord) == true);
00041 validateRead1(samRecord);
00042
00043
00044 assert(SamRecordHelper::checkSequence(samRecord,
00045 TestValidate::READ1_POS,
00046 TestValidate::READ1_SEQ.c_str()) == 0);
00047
00048
00049
00050 assert(SamRecordHelper::checkSequence(samRecord, 1010, "CCGAA") == 0);
00051
00052
00053 assert(SamRecordHelper::checkSequence(samRecord, 1010, "NNNNN") == -1);
00054
00055
00056 assert(SamRecordHelper::checkSequence(samRecord, 1011, "CGA") == 1);
00057
00058
00059 assert(SamRecordHelper::checkSequence(samRecord, 1011, "CGAA") == 1);
00060
00061
00062 assert(SamRecordHelper::checkSequence(samRecord, 1011, "CGAAC") == -1);
00063
00064 }
00065
00066