[svn] commit: r1765 - in /trunk/src/lib: cc/data.cc python/isc/cc/message.py python/isc/cc/tests/Makefile.am python/isc/cc/tests/test.py

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Apr 21 01:47:25 UTC 2010


Author: jreed
Date: Wed Apr 21 01:47:25 2010
New Revision: 1765

Log:
Commit patch from jelte in ticket #156 to
fix boolean tests failure.

Re-enable test.py. It now works:

  Running test: test.py
  .....................
  ----------------------------------------------------------------------
  Ran 21 tests in 0.002s
 
  OK
 
This may be fixed a different way, but for now this is a workaround
for the test.
jelte said in jabber: "i know of no code that uses boolean values
in messages right now ... certainly no data specifications"

Modified:
    trunk/src/lib/cc/data.cc
    trunk/src/lib/python/isc/cc/message.py
    trunk/src/lib/python/isc/cc/tests/Makefile.am
    trunk/src/lib/python/isc/cc/tests/test.py

Modified: trunk/src/lib/cc/data.cc
==============================================================================
--- trunk/src/lib/cc/data.cc (original)
+++ trunk/src/lib/cc/data.cc Wed Apr 21 01:47:25 2010
@@ -898,9 +898,9 @@
 {
     ss << encode_length(1, ITEM_BOOL);
     if (boolValue()) {
-        ss << 0x01;
-    } else {
-        ss << 0x00;
+        ss << '1';
+    } else {
+        ss << '0';
     }
 }
 

Modified: trunk/src/lib/python/isc/cc/message.py
==============================================================================
--- trunk/src/lib/python/isc/cc/message.py (original)
+++ trunk/src/lib/python/isc/cc/message.py Wed Apr 21 01:47:25 2010
@@ -200,7 +200,7 @@
     return (value, data)
 
 def _decode_bool(data):
-    return data == b'1' or data == b'0x01'
+    return data == b'1'
 
 def _decode_int(data):
     return int(str(data, 'utf-8'))

Modified: trunk/src/lib/python/isc/cc/tests/Makefile.am
==============================================================================
--- trunk/src/lib/python/isc/cc/tests/Makefile.am (original)
+++ trunk/src/lib/python/isc/cc/tests/Makefile.am Wed Apr 21 01:47:25 2010
@@ -1,12 +1,8 @@
-# NOTE: test.py remove since is broken. See ticket #156
-PYTESTS = data_test.py session_test.py
+PYTESTS = data_test.py session_test.py test.py
 # NOTE: test_session.py is to be run manually, so not automated.
 EXTRA_DIST = $(PYTESTS)
 EXTRA_DIST += sendcmd.py
 EXTRA_DIST += test_session.py
-
-# TODO: remove this when readded to PYTESTS
-EXTRA_DIST += test.py
 
 # later will have configure option to choose this, like: coverage run --branch
 PYCOVERAGE = $(PYTHON)

Modified: trunk/src/lib/python/isc/cc/tests/test.py
==============================================================================
--- trunk/src/lib/python/isc/cc/tests/test.py (original)
+++ trunk/src/lib/python/isc/cc/tests/test.py Wed Apr 21 01:47:25 2010
@@ -80,11 +80,11 @@
 
     def test_to_wire_of_bool_true(self):
         wire = isc.cc.message.to_wire({ "bool": True })
-        self.assertEqual(wire, b'Skan\x04bool%\x01\x01')
+        self.assertEqual(wire, b'Skan\x04bool%\x011')
 
     def test_to_wire_of_bool_false(self):
         wire = isc.cc.message.to_wire({ "bool": False })
-        self.assertEqual(wire, b'Skan\x04bool%\x01\x00')
+        self.assertEqual(wire, b'Skan\x04bool%\x010')
 
     def test_from_wire_of_bool_true(self):
         wire = b'Skan\x04bool%\x01\x01'




More information about the bind10-changes mailing list