annotate libtests/0039/prog1.c @ 636:9cda689dcc20

Use an appropriate data copier for the platform's bit width Dispatch on sb-vm:n-word-bits, though I think sbcl itself should probably define a system-area-double-float-copy bit-bash function. This also fixes a thinko, where only half of the times data was being copied, even on 64-bit platforms. Sheesh. Fixes #32
author mas01cr
date Tue, 29 Sep 2009 16:23:42 +0000
parents e18843dc0aea
children
rev   line source
mas01cr@548 1 #include "audioDB_API.h"
mas01cr@548 2 #include "test_utils_lib.h"
mas01cr@548 3
mas01cr@548 4 int main(int argc, char *argv[]) {
mas01cr@548 5 adb_t *adb;
mas01cr@548 6 adb_liszt_results_t *liszt;
mas01cr@548 7
mas01cr@548 8 clean_remove_db(TESTDB);
mas01cr@548 9 if(!(adb = audiodb_create(TESTDB, 0, 0, 0)))
mas01cr@548 10 return 1;
mas01cr@548 11 adb_datum_t datum1 = {2, 2, "testfeature01", (double[4]) {0, 1, 1, 0}};
mas01cr@548 12 adb_datum_t datum2 = {2, 2, "testfeature10", (double[4]) {1, 0, 0, 1}};
mas01cr@548 13 if(audiodb_insert_datum(adb, &datum1))
mas01cr@548 14 return 1;
mas01cr@548 15 if(audiodb_insert_datum(adb, &datum2))
mas01cr@548 16 return 1;
mas01cr@548 17
mas01cr@548 18 liszt = audiodb_liszt(adb);
mas01cr@548 19 if(!liszt || liszt->nresults != 2)
mas01cr@548 20 return 1;
mas01cr@548 21 entry_present_or_fail(liszt, "testfeature01", 2);
mas01cr@548 22 entry_present_or_fail(liszt, "testfeature10", 2);
mas01cr@548 23 audiodb_liszt_free_results(adb, liszt);
mas01cr@548 24
mas01cr@548 25 audiodb_close(adb);
mas01cr@548 26
mas01cr@548 27 return 104;
mas01cr@548 28 }