From: Ben Pfaff <blp@nicira.com>
Date: Mon, 12 Mar 2012 21:46:56 +0000 (-0700)
Subject: tests: Skip "strings at least 2 characters long" test for narrow Python.
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a91d5bd3a9e5cf8ee33dd75de4ceb18f2b07c3ac;p=sliver-openvswitch.git

tests: Skip "strings at least 2 characters long" test for narrow Python.

Narrow Python can't handle Unicode characters outside the BMP, so skip the
test.

Reported-by: Michael Shigorin <mike@osdn.org.ua>
Tested-by: Michael Shigorin <mike@osdn.org.ua>
Signed-off-by: Ben Pfaff <blp@nicira.com>
---

diff --git a/AUTHORS b/AUTHORS
index cd8872e94..b955efe05 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -111,6 +111,7 @@ Luiz Henrique Ozaki     luiz.ozaki@gmail.com
 Michael A. Collins      mike.a.collins@ark-net.org
 Michael Hu              mhu@nicira.com
 Michael Mao             mmao@nicira.com
+Michael Shigorin        mike@osdn.org.ua
 Mike Bursell            mike.bursell@citrix.com
 Mike Kruze              mkruze@nicira.com
 Murphy McCauley         murphy.mccauley@gmail.com
diff --git a/tests/ovsdb-data.at b/tests/ovsdb-data.at
index b74e68217..51d32e731 100644
--- a/tests/ovsdb-data.at
+++ b/tests/ovsdb-data.at
@@ -466,7 +466,12 @@ OVSDB_CHECK_POSITIVE_CPY([strings at least 2 characters long],
 constraint violation: "a" length 1 is less than minimum allowed length 2
 "ab"
 "abc"
-constraint violation: "𝄞" length 1 is less than minimum allowed length 2]])
+constraint violation: "𝄞" length 1 is less than minimum allowed length 2]],
+  [],
+  [],
+  [dnl This test requires a wide build of Python.
+   AT_CHECK([$PYTHON -c 'unichr(0x10000)' || exit 77],
+            [0], [ignore], [ignore])])
 
 OVSDB_CHECK_POSITIVE_CPY([strings no more than 2 characters long],
   [[parse-atoms '{"type": "string", "maxLength": 2}' \
diff --git a/tests/ovsdb.at b/tests/ovsdb.at
index 1620f695a..3e9918ab4 100644
--- a/tests/ovsdb.at
+++ b/tests/ovsdb.at
@@ -12,26 +12,26 @@ m4_define([OVSDB_CHECK_POSITIVE],
    AT_CLEANUP])
 
 # OVSDB_CHECK_POSITIVE_PY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ],
-#                         [XFAIL])
+#                         [PY-CHECK])
 #
 # Runs "test-ovsdb.py TEST-OVSDB-ARGS" and checks that it exits with
 # status 0 and prints OUTPUT on stdout.
 #
-# If XFAIL is nonempty then the test is expected to fail (presumably because
-# this test works in the C implementation but does not work in Python yet)
+# PY-CHECK is expanded before the check.  It can check for features of the
+# Python implementation that are required for the test to pass.
 #
 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
 m4_define([OVSDB_CHECK_POSITIVE_PY], 
   [AT_SETUP([$1])
    AT_SKIP_IF([test $HAVE_PYTHON = no])
-   m4_if([$6], [], [], [AT_XFAIL_IF([:])])
+   $6
    AT_KEYWORDS([ovsdb positive Python $4])
    AT_CHECK([$PYTHON $srcdir/test-ovsdb.py $2], [0], [$3
 ], [])
    AT_CLEANUP])
 
 # OVSDB_CHECK_POSITIVE_CPY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS],
-#                          [PREREQ], [PY-XFAIL])
+#                          [PREREQ], [PY-CHECK])
 #
 # Runs identical C and Python tests, as specified.
 m4_define([OVSDB_CHECK_POSITIVE_CPY],