Index: trunk/test/testcompile.sh
===================================================================
--- trunk/test/testcompile.sh	(revision 170)
+++ trunk/test/testcompile.sh	(revision 171)
@@ -20,5 +20,94 @@
 #
 
-MAXTEST=71; export MAXTEST
+# dnmalloc + flawfinder + (35 * 3)
+MAXTEST=107; export MAXTEST
+
+run_dnmalloc ()
+{
+    fail=0
+    if test x$1 = x0; then
+	[ -z "$verbose" ]     ||  log_msg_ok  "configure...";
+	$MAKE clean > /dev/null 2>> test_log
+	$MAKE test_dnmalloc > /dev/null 2>> test_log
+	if test x$? = x0; then
+	    [ -z "$verbose" ] || log_msg_ok   "make test_dnmalloc...";
+ 	else
+	    [ -z "$quiet" ] &&   log_msg_fail "make test_dnmalloc...";
+	    fail=1
+	fi
+    else
+	[ -z "$quiet" ] &&       log_msg_fail "configure...";
+	if [ x"$3" = xskip ]; then
+	    [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "test dnmalloc";
+	fi
+	fail=1
+    fi
+    if [ $fail -eq 1 ]; then
+	[ -z "$quiet" ] && log_fail $2 ${MAXTEST} "test dnmalloc";
+	return 1
+    fi
+    #
+    fail=0
+    ./test_dnmalloc >/dev/null
+    if test x$? = x0; then
+	[ -z "$verbose" ] || log_msg_ok   "run 1 completed...";
+	./test_dnmalloc 300 12 3000 150000 400 >/dev/null
+	if test x$? = x0; then
+	    [ -z "$verbose" ] || log_msg_ok   "run 2 completed...";
+	    ./test_dnmalloc 1 1 4000 10000000 1000 >/dev/null
+	    if test x$? = x0; then
+		[ -z "$verbose" ] || log_msg_ok   "run 3 completed...";
+		./test_dnmalloc 1 1 4000 10000000 1000 >/dev/null
+		if test x$? = x0; then
+		    [ -z "$verbose" ] || log_msg_ok   "run 4 completed...";
+		else
+		    fail=1
+		fi
+	    else
+		fail=1
+	    fi
+	else
+	    fail=1
+	fi
+    else
+	fail=1
+    fi
+    #
+    if test x$fail = x0; then
+	[ -z "$quiet" ] &&     log_ok   $2 ${MAXTEST} "test dnmalloc";
+	return 0
+    else
+	[ -z "$quiet" ] && log_fail $2 ${MAXTEST} "test dnmalloc";
+	return 1
+    fi
+}
+
+run_uno ()
+{
+    if [ -z "$doall" ]; then
+	[ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (uno)";
+	return 0
+    fi
+    #
+    UNO=`find_path uno`
+    #
+    if [ -z "$UNO" ]; then
+	log_skip $num $MAXTEST 'check w/uno (not in PATH)'
+	return 0
+    fi
+    #
+    cd src/
+    stat=`uno -DUSE_UNO=1 -t -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc-portable.c zAVLTree.c trustfile.c rijndael-*.c bignum.c 2>&1 | wc -l`
+    if [ $stat -ne 1 ]; then
+	uno -DSH_WITH_CLIENT -DSH_WITH_SERVER -DUSE_UNO=1 -t -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc-portable.c zAVLTree.c trustfile.c rijndael-*.c bignum.c >>../test_log 2>&1
+	retval=1
+	[ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST (uno)";
+    else
+	retval=0
+	[ -z "$quiet" ] &&     log_ok   $2 ${MAXTEST} "$TEST (uno)";
+    fi
+    cd ..
+    return $retval
+}
 
 run_flawfinder ()
@@ -45,5 +134,5 @@
 
     if [ ! -f "./x_samhain.c.sm" ]; then
-	[ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (skip smatch)";
+	[ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (skip sm)";
 	return 0
     fi
@@ -142,14 +231,28 @@
 	log_start "COMPILE"
 
-	if [ -f /usr/local/gcc-smatch/bin/gcc ]; then
-	    SAVE_CC="${CC}"
-	    SMATCH="DBGDEF=--smatch"; export SMATCH
-	    SAVE_SMATCH="${SMATCH}"; export SAVE_SMATCH
-	    CC="/usr/local/gcc-smatch/bin/gcc"; export CC
-	    SMATCH_CC="${CC}"
+	if [ "x$doall" = xon ]; then
+	    if [ -f /usr/local/gcc-smatch/bin/gcc ]; then  # FIXME
+		SAVE_CC="${CC}"
+		SMATCH="DBGDEF=--smatch"; export SMATCH
+		SAVE_SMATCH="${SMATCH}"; export SAVE_SMATCH
+		CC="/usr/local/gcc-smatch/bin/gcc"; export CC
+		SMATCH_CC="${CC}"
+	    fi
 	fi
 
 	num=0
 	numfail=0
+
+	#
+	# test dnmalloc
+	#
+        TEST="${S}check dnmalloc${E}"
+	#
+	${TOP_SRCDIR}/configure --quiet > /dev/null 2>> test_log
+	#
+	let "num = num + 1" >/dev/null
+	#
+	run_dnmalloc 0 $num || let "numfail = numfail + 1"  >/dev/null
+	#
 
 	#
@@ -184,4 +287,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -202,4 +307,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	#
 	[ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
@@ -219,4 +326,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -235,4 +344,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -251,4 +362,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 
@@ -268,4 +381,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -284,4 +399,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -300,4 +417,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -323,4 +442,6 @@
 	    let "num = num + 1" >/dev/null
 	    run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	    let "num = num + 1" >/dev/null
+	    run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	fi
 
@@ -340,4 +461,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -356,4 +479,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -372,4 +497,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -388,4 +515,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -404,4 +533,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -420,4 +551,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -436,4 +569,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -452,4 +587,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	# echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
@@ -470,4 +607,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	
 	if test -r "Makefile"; then
@@ -481,4 +620,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -499,4 +640,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	
 	if test -r "Makefile"; then
@@ -510,4 +653,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	#
 	[ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; }
@@ -538,4 +683,6 @@
 	    let "num = num + 1" >/dev/null
 	    run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	    let "num = num + 1" >/dev/null
+	    run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	    #
 	    if test -r "Makefile"; then
@@ -549,4 +696,6 @@
 	    let "num = num + 1" >/dev/null
 	    run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	    let "num = num + 1" >/dev/null
+	    run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	fi
 
@@ -567,4 +716,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	#
 	if test -r "Makefile"; then
@@ -578,4 +729,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -594,4 +747,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	#
 	if test -r "Makefile"; then
@@ -605,4 +760,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -621,4 +778,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	#
 	if test -r "Makefile"; then
@@ -632,4 +791,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -648,4 +809,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	#
 	if test -r "Makefile"; then
@@ -659,4 +822,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -675,4 +840,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	#
 	if test -r "Makefile"; then
@@ -686,4 +853,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num debug || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	#
@@ -702,4 +871,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 	#
 	if test -r "Makefile"; then
@@ -713,4 +884,6 @@
 	let "num = num + 1" >/dev/null
 	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_uno $? $num || let "numfail = numfail + 1"  >/dev/null
 
 	[ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
