Mercurial > hg > audiodb
comparison libtests/0026/prog1.c @ 498:342822c2d49a
Merge api-inversion branch (-r656:771, but I don't expect to return to
that branch) into the trunk.
I expect there to be minor performance regressions (e.g. in the SOAP
server index cacheing, which I have forcibly removed) and minor
unplugged memory leaks (e.g. in audioDB::query(), where I don't free up
the datum). I hope that these leaks and performance regressions can be
plugged in short order. I also expect that some (but maybe not all) of
the issues currently addressed in the memory-leaks branch are superseded
or fixed by this merge.
There remains much work to be done; go forth and do it.
author | mas01cr |
---|---|
date | Sat, 10 Jan 2009 16:47:57 +0000 |
parents | 94c18f128ce8 |
children |
comparison
equal
deleted
inserted
replaced
476:a7193678280b | 498:342822c2d49a |
---|---|
1 #include <stdio.h> | 1 #include "audioDB_API.h" |
2 #include <stdlib.h> | 2 #include "test_utils_lib.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 | 3 |
14 #include "../../audioDB_API.h" | 4 int main(int argc, char **argv) { |
15 #include "../test_utils_lib.h" | 5 adb_t *adb; |
6 | |
7 clean_remove_db(TESTDB); | |
8 if(!(adb = audiodb_create(TESTDB, 0, 0, 0))) | |
9 return 1; | |
16 | 10 |
11 if(audiodb_power(adb)) | |
12 return 1; | |
13 if(audiodb_power(adb)) | |
14 return 1; | |
17 | 15 |
18 int main(int argc, char **argv){ | 16 audiodb_close(adb); |
19 | 17 |
20 int returnval=0; | 18 return 104; |
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 } | 19 } |
56 |