diff --git a/make.sh b/make.sh index f257882..c84f7c9 100755 --- a/make.sh +++ b/make.sh @@ -120,9 +120,9 @@ fi cd src cp Makefile.in Makefile -perl -pi -e "s#\\\$\(CFLAGS\)#$CFLAGS#g" Makefile -perl -pi -e "s#\\\$\(LIBS\)#$LIBS#g" Makefile -perl -pi -e "s#\\\$\(LIB_VERSION\)#$LIB_VERSION#g" Makefile +sed -i "s/\\\$(CFLAGS)/$CFLAGS/g" Makefile +sed -i "s/\\\$(LIBS)/$LIBS/g" Makefile +sed -i "s/\\\$(LIB_VERSION)/$LIB_VERSION/g" Makefile make $1 $2 $3 if [ "$1" = "clean" ]; then diff --git a/src/Makefile.in b/src/Makefile.in index b41c770..fa213f8 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -3,7 +3,6 @@ COMPILE = $(CC) $(CFLAGS) INC_PATH = LIB_PATH = $(LIBS) -LIB_VERSION = $(LIB_VERSION) FAST_SHARED_OBJS = hash.lo chain.lo shared_func.lo ini_file_reader.lo \ logger.lo sockopt.lo base64.lo sched_thread.lo \ diff --git a/src/tests/test_skiplist.c b/src/tests/test_skiplist.c index 2f6b7db..cc65491 100644 --- a/src/tests/test_skiplist.c +++ b/src/tests/test_skiplist.c @@ -61,6 +61,20 @@ static int test_insert() return 0; } +static void test_delete() +{ + int i; + int64_t start_time; + int64_t end_time; + + start_time = get_current_time_ms(); + for (i=1; i<=COUNT; i++) { + assert(skiplist_delete(&sl, &i) == 0); + } + end_time = get_current_time_ms(); + printf("delete time used: %"PRId64" ms\n", end_time - start_time); +} + int main(int argc, char *argv[]) { int i; @@ -97,12 +111,7 @@ int main(int argc, char *argv[]) test_insert(); - start_time = get_current_time_ms(); - for (i=1; i<=COUNT; i++) { - assert(skiplist_delete(&sl, &i) == 0); - } - end_time = get_current_time_ms(); - printf("delete time used: %"PRId64" ms\n", end_time - start_time); + test_delete(); start_time = get_current_time_ms(); for (i=1; i<=COUNT; i++) { @@ -121,6 +130,7 @@ int main(int argc, char *argv[]) test_insert(); + test_delete(); skiplist_destroy(&sl); printf("pass OK\n");