From 0d7351093be8d69fea707308d83ecf6366c1fb86 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Sun, 4 Jun 2017 10:29:32 +0200 Subject: [PATCH] rm printfs --- datastore/keyvalue/clixon_keyvalue.c | 7 ------- test/lib.sh | 14 ++++++++------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/datastore/keyvalue/clixon_keyvalue.c b/datastore/keyvalue/clixon_keyvalue.c index 7207acfb..12cd201b 100644 --- a/datastore/keyvalue/clixon_keyvalue.c +++ b/datastore/keyvalue/clixon_keyvalue.c @@ -900,7 +900,6 @@ kv_lock(xmldb_handle xh, { int retval = -1; // struct kv_handle *kh = handle(xh); - fprintf(stderr, "%s %s %d\n", __FUNCTION__, db, pid); if (strcmp("running", db) == 0) _running_locked = pid; else if (strcmp("candidate", db) == 0) @@ -912,8 +911,6 @@ kv_lock(xmldb_handle xh, goto done; } clicon_debug(1, "%s: locked by %u", db, pid); - fprintf(stderr, "running:%d candidate:%d startup:%d\n", - _running_locked, _candidate_locked, _startup_locked); retval = 0; done: return retval; @@ -933,7 +930,6 @@ kv_unlock(xmldb_handle xh, { int retval = -1; // struct kv_handle *kh = handle(xh); - fprintf(stderr, "%s %s\n", __FUNCTION__, db); if (strcmp("running", db) == 0) _running_locked = 0; else if (strcmp("candidate", db) == 0) @@ -984,9 +980,6 @@ kv_islocked(xmldb_handle xh, int retval = -1; // struct kv_handle *kh = handle(xh); - fprintf(stderr, "%s %s\n", __FUNCTION__, db); - fprintf(stderr, "running:%d candidate:%d startup:%d\n", - _running_locked, _candidate_locked, _startup_locked); if (strcmp("running", db) == 0) retval = _running_locked; else if (strcmp("candidate", db) == 0) diff --git a/test/lib.sh b/test/lib.sh index 61796c86..423e0c22 100755 --- a/test/lib.sh +++ b/test/lib.sh @@ -5,7 +5,9 @@ testnname= clixon_cf=/usr/local/etc/routing.conf # error and exit, arg is optional extra errmsg err(){ - echo "Error in Test$testnr [$testname] $1" + echo "Error in Test$testnr [$testname]:" + echo "Expected: $1" + echo "Received: $2" exit $testnr } @@ -28,7 +30,7 @@ expectfn(){ fi ret=`$cmd` if [ $? -ne 0 ]; then - err + err "wrong args" fi # Match if both are empty string if [ -z "$ret" -a -z "$expect" ]; then @@ -40,12 +42,12 @@ expectfn(){ # echo "expect:\"$expect\"" # echo "match:\"$match\"" if [ -z "$match" ]; then - err "Expected:\"$expect\" Got:\"$ret\"" + err $expect "$ret" fi if [ -n "$expect2" ]; then match=`echo "$ret" | grep -EZo "$expect2"` if [ -z "$match" ]; then - err "Expected:\"$expect\" Got: \"$ret\"" + err $expect "$ret" fi fi } @@ -71,7 +73,7 @@ EOF # echo "expect:\"$expect\"" # echo "match:\"$match\"" if [ -z "$match" ]; then - err "Expected:\"$expect\" Got: \"$ret\"" + err "$expect" "$ret" fi } @@ -88,7 +90,7 @@ expectwait(){ read ret match=$(echo "$ret" | grep -Eo "$expect"); if [ -z "$match" ]; then - err "\nExpected:\t\"$expect\"\nGot:\t\"$ret\"" + err $expect "$ret" fi break done