Changeset 3028 for trunk/test/bam.cc


Ignore:
Timestamp:
Apr 21, 2013, 2:37:31 AM (10 years ago)
Author:
Peter
Message:

functions to access, append, and remove aux field. refs #746

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/bam.cc

    r3026 r3028  
    5151#ifdef HAVE_LIBBAM
    5252using namespace omic;
     53
     54void test_aux(test::Suite& suite, const BamRead& b)
     55{
     56  suite.out() << "test aux\n";
     57  BamRead bam(b);
     58
     59  char c = 'h';
     60  int size = bam.aux_size();
     61  bam.aux_append("ZZ", 'A', 1, (uint8_t*)(&c));
     62  suite.out() << "size: " << size << " " << bam.aux_size() << "\n";
     63  suite.add(bam.aux_size() == size+4);
     64  bam.aux("ZZ");
     65  char c1 = bam_aux2A(bam.aux("ZZ"));
     66  suite.out() << c << "==" << c1 << "\n";
     67  suite.add(c==c1);
     68  bam.aux_del("ZZ");
     69  if (!suite.add(bam.aux_size() == size))
     70    suite.err() << "error: incorrect size: " << bam.aux_size() << "\n";
     71}
     72
    5373
    5474void test_cigar(test::Suite& suite, const BamRead& b, const BamHeader& hdr)
     
    144164  }
    145165  test_cigar(suite, bam, in.header());
     166  test_aux(suite, bam);
    146167}
    147168#endif
Note: See TracChangeset for help on using the changeset viewer.