[gobject-introspection] tests: fix warning tests message sorting...



commit 30b32be1aba7277077fa82b9ac28d07a41c60e50
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Tue May 28 17:28:20 2013 +0200

    tests: fix warning tests message sorting...
    
    ... by using the actual line numbers instead of sorting
    the whole expected/emitted string. The latter is wrong as
    for example tests/warn/annotationparser.h line 109
    got sorted before line 120 which got sorted before
    line 12.

 tests/warn/warningtester.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py
index fc3c3d2..63a1e64 100644
--- a/tests/warn/warningtester.py
+++ b/tests/warn/warningtester.py
@@ -130,8 +130,9 @@ def check(args):
 
     expected_warnings = _extract_expected(filename)
 
-    expected_warnings.sort()
-    emitted_warnings.sort()
+    sortkey = lambda x: int(x.split(':')[0])
+    expected_warnings.sort(key=sortkey)
+    emitted_warnings.sort(key=sortkey)
 
     if len(expected_warnings) != len(emitted_warnings):
         raise SystemExit('ERROR in %r: %d warnings were emitted, '


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]