Mercurial > hg > audiodb
comparison libtests/0002/prog1.c @ 489:4cb6c611f812 api-inversion
Begin removing uses of audiodb_query()
audiodb_query() is actually an unsupportable interface. It requires
access to the filesystem, does not (and cannot) actually support whole
swathes of functionality, is only implementable using code that is no
longer part of the core of audioDB (reporter.h), is in the way of fixing
memory leaks in the SOAP server, and is horrible to use to boot.
So, begin converting the libtests uses of audiodb_query() to
audio_query_spec(). In the process, go through the test code and
remove useless comments, pointless variables, and commented-out bits
of shell scripts.
author | mas01cr |
---|---|
date | Sat, 10 Jan 2009 15:32:53 +0000 |
parents | e072aa1611f5 |
children |
comparison
equal
deleted
inserted
replaced
488:f4dc8e47ee37 | 489:4cb6c611f812 |
---|---|
1 #include "audioDB_API.h" | 1 #include "audioDB_API.h" |
2 #include "test_utils_lib.h" | 2 #include "test_utils_lib.h" |
3 | 3 |
4 int main(int argc, char **argv) { | |
5 adb_t *adb; | |
6 adb_status_t status={0}; | |
4 | 7 |
5 int main(int argc, char **argv){ | 8 clean_remove_db(TESTDB); |
6 | 9 |
7 int returnval=0; | 10 adb = audiodb_create(TESTDB, 0, 0, 0); |
8 adb_ptr mydbp={0}; | |
9 adb_status_t mystatus={0}; | |
10 | 11 |
11 char * databasename="testdb"; | 12 if(audiodb_status(adb, &status)){ |
13 return 1; | |
14 } | |
15 if(status.numFiles != 0) | |
16 return 1; | |
12 | 17 |
13 //. ../test-utils.sh | 18 audiodb_close(adb); |
14 // | |
15 //if [ -f testdb ]; then rm -f testdb; fi | |
16 // | |
17 /* remove old directory */ | |
18 clean_remove_db(databasename); | |
19 | 19 |
20 /* create new db */ | 20 return 104; |
21 //${AUDIODB} -N -d testdb | |
22 // | |
23 mydbp=audiodb_create(databasename,0,0,0); | |
24 | |
25 | |
26 //# FIXME: at some point we will want to test that some relevant | |
27 //# information is being printed | |
28 //${AUDIODB} -S -d testdb | |
29 //${AUDIODB} -d testdb -S | |
30 | |
31 if(audiodb_status(mydbp,&mystatus)){ | |
32 returnval=-1; | |
33 } | |
34 | |
35 /* not relevent, caught by API */ | |
36 //# should fail (no db given) | |
37 //expect_clean_error_exit ${AUDIODB} -S | |
38 | |
39 | |
40 | |
41 audiodb_close(mydbp); | |
42 | |
43 return(returnval); | |
44 } | 21 } |
45 | 22 |