TEST(Fastq, setValues)
{
    Fastq fq;
    fq.name("name");
    fq.seq("ACGT");
    fq.qual("IIII");
    EXPECT_EQ(0, fq.name().compare("name"));
    EXPECT_EQ(0, fq.seq().compare("ACGT"));
    EXPECT_EQ(0, fq.qual().compare("IIII"));
}
TEST(Fastq, DefaultConstructor)
{
    Fastq fq;
    EXPECT_EQ(0, fq.name().compare(""));
    EXPECT_EQ(0, fq.seq().compare(""));
    EXPECT_EQ(0, fq.qual().compare(""));
}
TEST(Fastq, ReadFromFile)
{
    Fastq fq;
    unsigned int counter = 0;
    ifstream inStream("test_files/fastq_unittest.fastq");

    if (! inStream.is_open())
    {
        cerr << "Error opening test file test_files/fastq_unittest.fastq" << endl;
        exit(1);
    }

    while (fq.fillFromFile(inStream))
    {
        counter++;
        string expectedName = static_cast<ostringstream*>( &(ostringstream() << counter) )->str();
        EXPECT_EQ(0, fq.name().compare(expectedName));
        EXPECT_EQ(0, fq.seq().compare("ACGT"));
    }
}
示例#4
0
void check_fastq_fields(const Fastq& record, const string& name, const string& comment, const string& sequence, const string& quals) {
  BOOST_CHECK_EQUAL(record.name()    , name);
  BOOST_CHECK_EQUAL(record.comment() , comment);  
  BOOST_CHECK_EQUAL(record.sequence(), sequence);
  BOOST_CHECK_EQUAL(record.quals()   , quals);
}