Changeset 3055 for trunk/test/bam.cc


Ignore:
Timestamp:
Jun 16, 2013, 2:21:30 AM (8 years ago)
Author:
Peter
Message:

closes #746. New function BamRead::name(1)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/bam.cc

    r3031 r3055  
    167167
    168168
     169void test_name(test::Suite& suite, const BamRead& b)
     170{
     171  suite.out() << "test name\n";
     172  BamRead bam(b);
     173  std::string name = "my-new-name";
     174  bam.name(name);
     175  if (bam.name() != name) {
     176    suite.add(false);
     177    suite.err() << "error: name: '" << bam.name()
     178                << "' expected: '" << name << "'\n";
     179  }
     180  // check that other fields are not changed
     181  if (bam.cigar_str()!=b.cigar_str()) {
     182    suite.add(false);
     183    suite.err() << "error: cigar str:" << bam.cigar_str() << " != "
     184                << b.cigar_str() << "\n";
     185  }
     186  if (bam.sequence()!=b.sequence()) {
     187    suite.add(false);
     188    suite.err() << "error: sequence:" << bam.sequence() << " != "
     189                << b.sequence() << "\n";
     190  }
     191}
     192
     193
    169194void test1(test::Suite& suite)
    170195{
     
    213238  test_aux(suite, bam);
    214239  test_sequence(suite, bam);
    215 }
    216 #endif
     240  test_name(suite, bam);
     241}
     242#endif
Note: See TracChangeset for help on using the changeset viewer.