17 #include <sys/times.h>
19 static void runtests(FILE *out,
const char *outputfile) {
24 PS_BitSet_Fast *x =
new PS_BitSet_Fast(
false, 20);
32 x->print(out,
true, 20);
34 fprintf(out,
"true index count = %li\n", x->getCountOfTrues());
38 x->getTrueIndices(indices);
39 fprintf(out,
" true indices (%2zu) : ", indices.size());
40 for (PS_BitSet::IndexSet::iterator i=indices.begin(); i != indices.end(); ++i) {
41 fprintf(out,
" %4li", *i);
45 x->getTrueIndices(indices, 15);
46 fprintf(out,
" true indices (%2zu) : ", indices.size());
47 for (PS_BitSet::IndexSet::iterator i=indices.begin(); i != indices.end(); ++i) {
48 fprintf(out,
" %4li", *i);
52 x->getFalseIndices(indices);
53 fprintf(out,
" false indices (%2zu) : ", indices.size());
54 for (PS_BitSet::IndexSet::iterator i=indices.begin(); i != indices.end(); ++i) {
55 fprintf(out,
" %4li", *i);
59 x->getFalseIndices(indices, 15);
60 fprintf(out,
" false indices (%2zu) : ", indices.size());
61 for (PS_BitSet::IndexSet::iterator i=indices.begin(); i != indices.end(); ++i) {
62 fprintf(out,
" %4li", *i);
70 PS_BitMap *map =
new PS_BitMap_Fast(
false, 10);
71 for (
long i = 0; i < 10; ++i) {
82 PS_BitMap_Counted *map2 =
new PS_BitMap_Counted(fb1);
88 map2->recalcCounters();
97 char str[] =
"ABCDEFG";
100 fprintf(out,
"%i %c %i\n", a, str[a], a+1); a++;
101 fprintf(out,
"%i %c %i\n", b, str[b+1], b+1); b++;
112 fprintf(out,
"%6i %6i\n", i->first, i->second);
119 char *data = (
char *)malloc(1024);
146 void TEST_probeset_basics() {
147 const char *textout =
"tools/probeset.out";
148 const char *dataout =
"tools/probeset.data";
152 FILE *out = fopen(textout,
"wt");
159 const char *textout_expected =
"tools/probeset.out.expected";
160 const char *dataout_expected =
"tools/probeset.data.expected";
162 #if defined(TEST_AUTO_UPDATE)
163 TEST_COPY_FILE(textout, textout_expected);
164 TEST_COPY_FILE(dataout, dataout_expected);
165 #else // !defined(TEST_AUTO_UPDATE)
void get(void *_data, int _length)
static const bool READONLY
static void runtests(FILE *out, const char *outputfile)
GB_ERROR GB_IO_error(const char *action, const char *filename)
int GB_unlink(const char *path)
virtual void print(FILE *out)
virtual bool set(const long _row, const long _col, const bool _value)
#define TEST_EXPECT_ZERO_OR_SHOW_ERRNO(iocond)
std::set< ID2IDPair > ID2IDSet
ID2IDSet::const_iterator ID2IDSetCIter
#define TEST_EXPECT_FILES_EQUAL(f1, f2)
#define TEST_EXPECT_NO_ERROR(call)
bool save(PS_FileBuffer *_file)
#define TEST_EXPECT_TEXTFILES_EQUAL(fgot, fwant)
int ARB_main(int, char *[])
std::pair< SpeciesID, SpeciesID > ID2IDPair
void reinit(const char *name, bool _readonly)
static const bool WRITEONLY
GB_write_int const char s