Mercurial > hg > audiodb
annotate libtests/0002/prog1.c @ 596:6ad0a6e67d4c
Take advantage of those new handy _or_goto_error macros
Use them in various places where previously we either elided the error
checking (various lseek() calls) or used a combination of calls
(replaced by malloc_and_fill_or_goto_error()).
In the process, fix what is probably a bug (or else introduce one, but I
don't think so): audiodb_track_id_datum() computed the offset into the
timesTable wrongly, forgetting to multiply by 2. (TODO: this should be
easily testable using the API).
Now all of LIBOBJS can be produced by my (Debian's) mingw32
cross-compiler, except for lshlib.o.
author | mas01cr |
---|---|
date | Tue, 11 Aug 2009 21:42:49 +0000 |
parents | 342822c2d49a |
children |
rev | line source |
---|---|
mas01cr@498 | 1 #include "audioDB_API.h" |
mas01cr@498 | 2 #include "test_utils_lib.h" |
mas01ik@355 | 3 |
mas01cr@498 | 4 int main(int argc, char **argv) { |
mas01cr@498 | 5 adb_t *adb; |
mas01cr@498 | 6 adb_status_t status={0}; |
mas01ik@355 | 7 |
mas01cr@498 | 8 clean_remove_db(TESTDB); |
mas01ik@355 | 9 |
mas01cr@498 | 10 adb = audiodb_create(TESTDB, 0, 0, 0); |
mas01ik@355 | 11 |
mas01cr@498 | 12 if(audiodb_status(adb, &status)){ |
mas01cr@498 | 13 return 1; |
mas01cr@498 | 14 } |
mas01cr@498 | 15 if(status.numFiles != 0) |
mas01cr@498 | 16 return 1; |
mas01ik@355 | 17 |
mas01cr@498 | 18 audiodb_close(adb); |
mas01ik@355 | 19 |
mas01cr@498 | 20 return 104; |
mas01ik@355 | 21 } |
mas01ik@355 | 22 |