AC_SUBST(PACKAGE_VERSION)
# Targets
-AC_OUTPUT(Makefile tcejdb.pc)
+AC_OUTPUT(Makefile tcejdb.pc testejdb/Makefile)
# Messages
printf '#================================================================\n'
#include <assert.h>
#include <pthread.h>
+#ifdef _WIN32
+#include <pcreposix.h>
+#else
+#include <regex.h>
+#endif
+
EJDB_EXTERN_C_START
#define BSON_IS_IDXSUPPORTED_TYPE(atype) (atype == BSON_STRING || \
/* Set the size of the extra mapped memory of a hash database object. */
bool tchdbsetxmsiz(TCHDB *hdb, int64_t xmsiz) {
#if defined (_WIN32) && defined(_DEBUG)
- fprintf(stderr, "\ntchdbsetxmsiz does not takes effect on windows platform\n");
+ //fprintf(stderr, "\ntchdbsetxmsiz does not takes effect on windows platform\n");
return true;
#else
assert(hdb);
-CC=gcc
-CPPFLAGS = -I. -I.. -DDEBUG -D_DEBUG -D_GNU_SOURCE=1 -D_REENTRANT -D__EXTENSIONS__
-CFLAGS = -std=c99 -Wall -fPIC -pedantic -fsigned-char -g -O0
-LDFLAGS = -L. -L..
+CC=@CC@
+CPPFLAGS = -I../ @MYCPPFLAGS@
+CFLAGS = @MYCFLAGS@
+LDFLAGS = -L../ @MYLDFLAGS@
CMDLDFLAGS =
-LIBS = -lz -lpthread -lm -lc -lcunit
+LIBS = -lcunit -ltcejdb @LIBS@
RUNENV = LD_LIBRARY_PATH=.:.. DYLD_LIBRARY_PATH=.:..
TESTS = t1 t2 t3 t4
rm -rf *.o $(TESTS) db* *.vlog
t1 : t1.o
- $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltcejdb $(CMDLDFLAGS) $(LIBS)
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CMDLDFLAGS) $(LIBS)
t2 : t2.o
- $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltcejdb $(CMDLDFLAGS) $(LIBS)
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CMDLDFLAGS) $(LIBS)
t3 : t3.o
- $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltcejdb $(CMDLDFLAGS) $(LIBS)
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CMDLDFLAGS) $(LIBS)
t4 : t4.o
- $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltcejdb $(CMDLDFLAGS) $(LIBS)
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CMDLDFLAGS) $(LIBS)
.PHONY : all clean check check-t1 check-t2 check-t3 check-t4
* Created on Sep 18, 2012, 10:42:19 PM
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include "CUnit/Basic.h"
-#include <assert.h>
+#include "myconf.h"
#include "ejdb_private.h"
+#include "CUnit/Basic.h"
+
/*
* CUnit Test Suite
* Created on Oct 1, 2012, 3:13:44 PM
*/
-#include "bson.h"
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "CUnit/Basic.h"
-#include <assert.h>
+#include "myconf.h"
#include "ejdb_private.h"
-#include <locale.h>
+#include "CUnit/Basic.h"
/*
* CUnit Test Suite
* Created on Oct 26, 2012, 12:12:45 PM
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <assert.h>
+#include "myconf.h"
#include "ejdb_private.h"
-#include <locale.h>
-#include <pthread.h>
-
#include "CUnit/Basic.h"
+#include <stdlib.h>
/*
* CUnit Test Suite
if (!ejdbopen(jb, "dbt3", JBOWRITER | JBOCREAT | JBOTRUNC)) {
return 1;
}
- srandom(tcmstime());
+ srand(tcmstime());
recs = malloc(RS * sizeof (bson));
if (!recs) {
return 1;
char str[128];
int len = 0;
do {
- len = random() % 128;
+ len = rand() % 128;
} while (len <= 0);
str[0] = 'A' + (i % 26);
for (int j = 1; j < len; ++j) {
- str[j] = 'a' + random() % 26;
+ str[j] = 'a' + rand() % 26;
}
str[len] = '\0';
bson_append_string(&bs, "rstring", str);
uint32_t acount = 0;
int i;
for (i = 0; i < QRS; ++i) {
- int idx = random() % QRS;
+ int idx = rand() % QRS;
bson *bs = recs + idx;
assert(bs);
EJQ *q = ejdbcreatequery(jb, bs, NULL, 0, NULL);
st = tcmstime();
acount = 0;
for (i = 0; i < QRS; ++i) {
- int idx = random() % QRS;
+ int idx = rand() % QRS;
bson *bs = recs + idx;
assert(bs);
EJQ *q = ejdbcreatequery(jb, bs, NULL, 0, NULL);
-#include <locale.h>
-#include <pthread.h>
+#include "myconf.h"
#include "ejdb_private.h"
-
#include "CUnit/Basic.h"
-
/*
* CUnit Test Suite
*/
if (!coll) {
eprint(jb, __LINE__, "testTicket53");
}
- CU_ASSERT_TRUE(coll);
+ CU_ASSERT_TRUE(coll != NULL);
ejdbclose(jb);
ejdbdel(jb);
}