]> sigrok.org Git - libsigrokdecode.git/commitdiff
pdtest: Always sanity-check all testcases.
authorBert Vermeulen <redacted>
Wed, 11 Dec 2013 11:39:50 +0000 (12:39 +0100)
committerBert Vermeulen <redacted>
Wed, 11 Dec 2013 11:39:50 +0000 (12:39 +0100)
tests/pdtest

index 59348d6957d4f1176b724da43b4a3b76735bf2c0..1258d27fadac74f6e0d68a6ce8f8c4e5ad6c4720 100755 (executable)
@@ -46,7 +46,7 @@ def usage(msg=None):
     sys.exit()
 
 
-def check_testcase(tc):
+def check_tclist(tc):
     if 'pdlist' not in tc or not tc['pdlist']:
         return("No protocol decoders")
     if 'input' not in tc or not tc['input']:
@@ -167,11 +167,11 @@ def parse_testfile(path, pd, tc, op_type, op_class):
             tclist = []
         else:
             tclist = [target_tc]
-            for t in tclist:
-                error = check_testcase(t)
-                if error:
-                    ERR("Error in %s: %s" % (path, error))
-                    return []
+    for t in tclist:
+        error = check_tclist(t)
+        if error:
+            ERR("Error in %s: %s" % (path, error))
+            return []
 
     return tclist