fix incomplete lookups for uci.get()
[project/uci.git] / test / tests.sh
index 52f1384..15a4744 100644 (file)
@@ -40,6 +40,23 @@ assertSameFile() {
                echo "----"
        }
 }
+assertNotSegFault()
+{
+       [ $1 -eq 139 ] && fail "Returned with 139: segmentation fault (SIGSEGV)!!!"
+}
+assertNotIllegal()
+{
+       [ $1 -eq 132 ] && fail "Returned with 132: Illegal instruction (SIGILL)!!!"
+}
+assertFailWithNoReturn() {
+       local test="$1"
+       value=$( $test )
+       rv=$?
+       assertFalse "'$test' does not fail" $rv
+       assertNotSegFault $rv
+       assertNotIllegal $rv
+       assertNull "'$test' returns '$value'" "$value"
+}
 EOF
 
 for suite in $(ls ${SCRIPTS_DIR}/*)