Changeset 2482
- Timestamp:
- Apr 25, 2011, 12:17:19 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/gff.cc
r2453 r2482 22 22 #include "Suite.h" 23 23 24 #include "yat/omic/GFF2.h" 25 #include "yat/omic/GFF3.h" 26 27 #include <fstream> 28 24 29 using namespace theplu::yat; 30 using namespace omic; 31 32 template<typename T> 33 void avoid_pedantic_warning(T t) {} 34 35 void gff2(test::Suite&); 36 void gff3(test::Suite&); 37 38 template<class T> 39 void test_gff(test::Suite&, GFF&); 25 40 26 41 int main(int argc, char* argv[]) … … 28 43 test::Suite suite(argc, argv); 29 44 45 gff2(suite); 46 gff3(suite); 47 30 48 return suite.return_value(); 31 49 } 50 51 52 void test_gff(test::Suite& suite, GFF& gff) 53 { 54 std::string seqid = gff.seqid(); 55 std::string source = gff.source(); 56 std::string type = gff.type(); 57 avoid_pedantic_warning<const std::string&>(gff.start()); 58 avoid_pedantic_warning<const std::string&>(gff.end()); 59 avoid_pedantic_warning<const std::string&>(gff.score()); 60 avoid_pedantic_warning<const std::string&>(gff.strand()); 61 avoid_pedantic_warning<const std::string&>(gff.phase()); 62 const std::map<std::string, std::string>& m = gff.attributes(); 63 avoid_pedantic_warning(m); 64 } 65 66 void gff2(test::Suite& suite) 67 { 68 suite.out() << "testing GFF2\n"; 69 std::ifstream is(test::filename("data/small.gff2").c_str()); 70 assert(is); 71 GFF2 gff2; 72 suite.add(getline(is, gff2)); 73 test_gff(suite, gff2); 74 const std::string& a = gff2.attribute("genotype"); 75 if (!suite.add(a=="T or C")) 76 suite.err() << "incorrect genotype value: `" << a << "'\n" 77 << "expected: `T or C'\n"; 78 is.close(); 79 } 80 81 void gff3(test::Suite& suite) 82 { 83 suite.out() << "testing GFF3\n"; 84 std::ifstream is(test::filename("data/small.gff3").c_str()); 85 assert(is); 86 GFF3 gff3; 87 if (!suite.add(getline(is, gff3))) 88 suite.err() << "getline failed\n"; 89 test_gff(suite, gff3); 90 const std::string& a = gff3.attribute("genotype"); 91 if (!suite.add(a=="T")) 92 suite.err() << "incorrect genotype value: `" << a << "'\n" 93 << "expected: `T'\n"; 94 is.close(); 95 } -
trunk/yat/omic/Makefile.am
r2368 r2482 3 3 ## $Id$ 4 4 5 # Copyright (C) 2010 Peter Johansson5 # Copyright (C) 2010, 2011 Peter Johansson 6 6 # 7 7 # This file is part of the yat library, http://dev.thep.lu.se/yat … … 25 25 libomic_la_SOURCES += DNA.cc 26 26 libomic_la_SOURCES += GenomicPosition.cc 27 libomic_la_SOURCES += GFF.cc 28 libomic_la_SOURCES += GFF2.cc 29 libomic_la_SOURCES += GFF3.cc 27 30 28 31 include_omicdir = $(includedir)/yat/omic … … 32 35 include_omic_HEADERS += DNA.h 33 36 include_omic_HEADERS += GenomicPosition.h 37 include_omic_HEADERS += GFF.h 38 include_omic_HEADERS += GFF2.h 39 include_omic_HEADERS += GFF3.h 34 40 35 41 DISTCLEANFILES = doxygen.mk
Note: See TracChangeset
for help on using the changeset viewer.