Mercurial > hg > audiodb
comparison libtests/0002/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 adb_status_t mystatus={0}; | |
23 | |
24 char * databasename="testdb"; | |
25 | |
26 //. ../test-utils.sh | |
27 // | |
28 //if [ -f testdb ]; then rm -f testdb; fi | |
29 // | |
30 /* remove old directory */ | |
31 clean_remove_db(databasename); | |
32 | |
33 /* create new db */ | |
34 //${AUDIODB} -N -d testdb | |
35 // | |
36 mydbp=audiodb_create(databasename,0,0,0); | |
37 | |
38 | |
39 //# FIXME: at some point we will want to test that some relevant | |
40 //# information is being printed | |
41 //${AUDIODB} -S -d testdb | |
42 //${AUDIODB} -d testdb -S | |
43 | |
44 if(audiodb_status(mydbp,&mystatus)){ | |
45 returnval=-1; | |
46 } | |
47 | |
48 /* not relevent, caught by API */ | |
49 //# should fail (no db given) | |
50 //expect_clean_error_exit ${AUDIODB} -S | |
51 | |
52 | |
53 | |
54 audiodb_close(mydbp); | |
55 | |
56 return(returnval); | |
57 } | |
58 |