Commit 987351fb authored by Vincent Pelletier's avatar Vincent Pelletier

Change INVALID_[OID|TID] value.

OID 0 is a very valid oid. It's often used for the most important object of
the database: the root object. Using 0xffffffffffffffff leaves some space.

TID 0 is a very valid tid, for transactions back in unix year 0... or
ZODB tests. Using 0xffffffffffffffff leaves some space.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1977 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 4468d14d
......@@ -97,8 +97,8 @@ cell_state_prefix_dict = {
# Other constants.
INVALID_UUID = '\0' * 16
INVALID_TID = '\0' * 8
INVALID_OID = '\0' * 8
INVALID_TID = '\xff' * 8
INVALID_OID = '\xff' * 8
INVALID_PTID = '\0' * 8
INVALID_SERIAL = INVALID_TID
INVALID_PARTITION = 0xffffffff
......
......@@ -18,6 +18,7 @@
import unittest
from neo.protocol import NodeTypes, NodeStates, CellStates
from neo.protocol import ErrorCodes, Packets, Errors
from neo.protocol import INVALID_TID
from neo.tests import NeoTestBase
class ProtocolTests(NeoTestBase):
......@@ -241,7 +242,7 @@ class ProtocolTests(NeoTestBase):
def test_32_askBeginTransaction(self):
# try with an invalid TID, None must be returned
tid = '\0' * 8
tid = INVALID_TID
p = Packets.AskBeginTransaction(tid)
self.assertEqual(p.decode(), (None, ))
# and with another TID
......
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