comparison libtests/0026/prog1.c @ 355:94c18f128ce8

First version of the API, committed to the main trunk. Thanks Christophe, for all the help!
author mas01ik
date Wed, 12 Nov 2008 10:21:06 +0000
parents
children e072aa1611f5 342822c2d49a
comparison
equal deleted inserted replaced
354:4871a3ed9e36 355:94c18f128ce8
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <sysexits.h>
5 #include <fcntl.h>
6 #include <dirent.h>
7 #include <unistd.h>
8 #include <sys/stat.h>
9 /*
10 * * #define NDEBUG
11 * * */
12 #include <assert.h>
13
14 #include "../../audioDB_API.h"
15 #include "../test_utils_lib.h"
16
17
18 int main(int argc, char **argv){
19
20 int returnval=0;
21 adb_ptr mydbp={0};
22 // int ivals[10];
23 // double dvals[10];
24 // adbinsert myinsert={0};
25 // unsigned int myerr=0;
26 char * databasename="testdb";
27 // adbquery myadbquery={0};
28 // adbqueryresult myadbqueryresult={0};
29 // adbquery myadbquery2={0};
30 // adbqueryresult myadbqueryresult2={0};
31 int myerror=0;
32
33
34 /* remove old directory */
35 //if [ -f testdb ]; then rm -f testdb; fi
36 clean_remove_db(databasename);
37
38 /* create new db */
39 //${AUDIODB} -N -d testdb
40 mydbp=audiodb_create(databasename,0,0,0);
41
42 /* power flag on */
43 //${AUDIODB} -P -d testdb
44 //${AUDIODB} -d testdb -P
45 myerror=audiodb_power(mydbp);
46 if (myerror){
47 returnval=-1;
48 }
49
50 //# should fail (no db given)
51 //expect_clean_error_exit ${AUDIODB} -P
52 /* not relevent, API wouldn't compile */
53
54 return(returnval);
55 }
56