23 sprintf(buf,
"%d",
i);
30 printf(
"int[%d] has [", size);
31 for (
int i=0;
i<size;
i++) {
42 printf(
"int[%d] has [", size);
43 for (
int i=0;
i<size;
i++) {
55 printf(
"FAIL: %s\n", text);
61 printf(
"Depth bomb: creating test_odb/depth_bomb/down/down/...\n");
63 MVOdb *s = odb->Chdir(
"test_odb",
true);
64 s = s->Chdir(
"depth_bomb",
true);
73 p = p->Chdir(
"down",
true);
82 printf(
"Created tree %d deep\n", level);
85 odb->Delete(
"test_odb");
90 printf(
"Width bomb: creating test_odb/width_bomb_key/dir1,dir2,dir3,...\n");
92 MVOdb *s = odb->Chdir(
"test_odb",
true);
93 s = s->Chdir(
"width_bomb_key",
true);
104 p = s->Chdir(
name.c_str(),
true);
115 printf(
"Created %d subdirectories\n",
count);
118 odb->Delete(
"test_odb");
123 printf(
"Width bomb: creating test_odb/width_bomb_data/dir1,dir2,dir3,...\n");
125 MVOdb *s = odb->Chdir(
"test_odb",
true);
126 s = s->Chdir(
"width_bomb_data",
true);
134 for (
int i=0;
i<20;
i++) {
135 data += (char)(
'a' +
i);
148 s->RS(
name.c_str(), &r);
158 printf(
"Created %d subdirectories\n",
count);
161 odb->Delete(
"test_odb");
167 printf(
"Starting all tests:\n");
184int main(
int argc,
char *argv[])
189 signal(SIGILL, SIG_DFL);
190 signal(SIGBUS, SIG_DFL);
191 signal(SIGSEGV, SIG_DFL);
192 signal(SIGPIPE, SIG_DFL);
194 const char* hostname = NULL;
195 const char* exptname = NULL;
202 printf(
"Using TMFE ODB\n");
207 r = mfe->
Connect(
"test_odb", hostname, exptname);
209 fprintf(stderr,
"Cannot connect to MIDAS, error %s\n", r.
error_message.c_str());
213 odb = MakeMidasOdb(mfe->
fDB, &odberror);
215 if (odberror.fError) {
216 fprintf(stderr,
"Cannot make MVOdb object, error: %s\n", odberror.fErrorString.c_str());
220 for (
int i=0;
i<argc;
i++) {
221 std::string arg = argv[
i];
225 else if (arg ==
"--depth-bomb")
227 else if (arg ==
"--width-bomb-key")
229 else if (arg ==
"--width-bomb-data")
int fDB
ODB database handle.
TMFeResult Connect(const char *progname=NULL, const char *hostname=NULL, const char *exptname=NULL)
std::string error_message
std::string msprintf(const char *format,...)
static void test_width_bomb_data(MVOdb *odb, bool cleanup)
void print_da(const std::vector< double > &da)
void report_fail(const char *text)
void print_ia(const std::vector< int > &ia)
static void test_depth_bomb(MVOdb *odb, bool cleanup)
std::string toString(int i)
static void test_width_bomb_key(MVOdb *odb, bool cleanup)