Commit 692c80e1 authored by Dan Horák's avatar Dan Horák Committed by Martin Pitt
Browse files

Fix test for GBytes.compare()

The result of the compare method is defined as equal, less than or greater than zero
and the test must match to that. The underlaying memcmp() function can return other
values than -1, 0 and 1. For example on architectures where it is implemented directly
via a CPU instruction like on s390(x) where I can see -2 as a result instead of the
"expected" -1.

https://bugzilla.gnome.org/show_bug.cgi?id=690837
parent 948dbcb2
......@@ -1054,8 +1054,8 @@ class TestGBytes(unittest.TestCase):
self.assertFalse(b.equal(a2))
self.assertEqual(0, a1.compare(a2))
self.assertEqual(1, a1.compare(b))
self.assertEqual(-1, b.compare(a1))
self.assertLess(0, a1.compare(b))
self.assertGreater(0, b.compare(a1))
class TestGByteArray(unittest.TestCase):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment