Fixed internal test failures

The tests failed due old style initialization of the embedded server. This is
fixed by using the new qc_init and qc_thread_init functions.
This commit is contained in:
Markus Makela
2016-02-23 14:54:02 +02:00
parent 417380ab83
commit ac3adf820b
2 changed files with 8 additions and 52 deletions

View File

@ -7,26 +7,6 @@
#include <buffer.h>
#include <mysql.h>
static char* server_options[] =
{
"MariaDB Corporation MaxScale",
"--datadir=./",
"--language=./",
"--skip-innodb",
"--default-storage-engine=myisam",
NULL
};
const int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
static char* server_groups[] =
{
"embedded",
"server",
"server",
NULL
};
int main(int argc, char** argv)
{
unsigned int psize;
@ -48,11 +28,8 @@ int main(int argc, char** argv)
return 1;
}
if (mysql_library_init(num_elements, server_options, server_groups))
{
printf("Embedded server init failed.\n");
return 1;
}
qc_init("qc_mysqlembedded");
qc_thread_init();
infile = fopen(argv[1],"rb");
outfile = fopen(argv[2],"wb");
@ -87,7 +64,7 @@ int main(int argc, char** argv)
}
fclose(infile);
fclose(outfile);
mysql_library_end();
qc_thread_end();
qc_end();
return 0;
}

View File

@ -8,25 +8,6 @@
#include <mysql.h>
#include <unistd.h>
static char* server_options[] = {
"MariaDB Corporation MaxScale",
"--no-defaults",
"--datadir=.",
"--language=.",
"--skip-innodb",
"--default-storage-engine=myisam",
NULL
};
const int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
static char* server_groups[] = {
"embedded",
"server",
"server",
NULL
};
int main(int argc, char** argv)
{
if(argc < 3){
@ -37,11 +18,8 @@ int main(int argc, char** argv)
char buffer[1024], *strbuff = (char*)calloc(buffsz,sizeof(char));
FILE *input,*expected;
if(mysql_library_init(num_elements, server_options, server_groups))
{
printf("Error: Cannot initialize Embedded Library.");
return 1;
}
qc_init("qc_mysqlembedded");
qc_thread_init();
input = fopen(argv[1],"rb");
@ -189,7 +167,8 @@ int main(int argc, char** argv)
}
fclose(input);
fclose(expected);
mysql_library_end();
qc_thread_end();
qc_end();
free(strbuff);
return ex_val;
}