comparison libtests/0036/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 25a4d1799c08 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 int ivals[10];
23 double dvals[10];
24 adb_insert_t myinsert={0};
25 unsigned int myerr=0;
26 char * databasename="testdb";
27 adb_query_t myadbquery={0};
28 adb_queryresult_t myadbqueryresult={0};
29 adb_query_t myadbquery2={0};
30 adb_queryresult_t myadbqueryresult2={0};
31 int size=0;
32
33
34 //#! /bin/bash
35 //
36 //. ../test-utils.sh
37 //
38 //if [ -f testdb ]; then rm -f testdb; fi
39 //
40 //${AUDIODB} -d testdb -N
41 //
42 //intstring 2 > testfeature01
43 //floatstring 0 1 >> testfeature01
44 //floatstring 1 0 >> testfeature01
45 //intstring 2 > testfeature10
46 //floatstring 1 0 >> testfeature10
47 //floatstring 0 1 >> testfeature10
48 //
49 //cat > testfeaturefiles <<EOF
50 //testfeature01
51 //testfeature10
52 //EOF
53 //
54 //${AUDIODB} -d testdb -B -F testfeaturefiles
55 //
56 //# sequence queries require L2NORM
57 //${AUDIODB} -d testdb -L
58 //
59 //echo "query point (0.0,0.5)"
60 //intstring 2 > testquery
61 //floatstring 0 0.5 >> testquery
62 //
63 //${AUDIODB} -d testdb -Q nsequence -l 1 -f testquery > testoutput
64 //echo testfeature01 1 > test-expected-output
65 //echo 0 0 0 >> test-expected-output
66 //echo 2 0 1 >> test-expected-output
67 //echo testfeature10 1 >> test-expected-output
68 //echo 0 0 1 >> test-expected-output
69 //echo 2 0 0 >> test-expected-output
70 //cmp testoutput test-expected-output
71 //
72 //${AUDIODB} -d testdb -Q nsequence -l 1 -f testquery -n 2 > testoutput
73 //cmp testoutput test-expected-output
74 //
75 //${AUDIODB} -d testdb -Q nsequence -l 1 -f testquery -n 5 > testoutput
76 //cmp testoutput test-expected-output
77 //
78 //${AUDIODB} -d testdb -Q nsequence -l 1 -f testquery -n 1 > testoutput
79 //echo testfeature01 0 > test-expected-output
80 //echo 0 0 0 >> test-expected-output
81 //echo testfeature10 0 >> test-expected-output
82 //echo 0 0 1 >> test-expected-output
83 //cmp testoutput test-expected-output
84 //
85 //echo "query point (0.5,0.0)"
86 //intstring 2 > testquery
87 //floatstring 0.5 0 >> testquery
88 //
89 //${AUDIODB} -d testdb -Q nsequence -l 1 -f testquery > testoutput
90 //echo testfeature01 1 > test-expected-output
91 //echo 0 0 1 >> test-expected-output
92 //echo 2 0 0 >> test-expected-output
93 //echo testfeature10 1 >> test-expected-output
94 //echo 0 0 0 >> test-expected-output
95 //echo 2 0 1 >> test-expected-output
96 //cmp testoutput test-expected-output
97 //
98 //${AUDIODB} -d testdb -Q nsequence -l 1 -f testquery -n 2 > testoutput
99 //cmp testoutput test-expected-output
100 //
101 //${AUDIODB} -d testdb -Q nsequence -l 1 -f testquery -n 5 > testoutput
102 //cmp testoutput test-expected-output
103 //
104 //${AUDIODB} -d testdb -Q nsequence -l 1 -f testquery -n 1 > testoutput
105 //echo testfeature01 0 > test-expected-output
106 //echo 0 0 1 >> test-expected-output
107 //echo testfeature10 0 >> test-expected-output
108 //echo 0 0 0 >> test-expected-output
109 //cmp testoutput test-expected-output
110 //
111 //exit 104
112
113 returnval=-1;
114
115 return(returnval);
116 }
117