diff --git a/README.md b/README.md index 7c7814d..e30f691 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ depend : python-qt4, python-twisted, python-qt4reactor +this project is still in progress. diff --git a/rdpy/dotest.py b/rdpy/dotest.py new file mode 100644 index 0000000..49cc586 --- /dev/null +++ b/rdpy/dotest.py @@ -0,0 +1,18 @@ +''' +@author: sylvain +''' +import sys, os +# Change path so we find rdpy +sys.path.insert(1, os.path.join(sys.path[0], '..')) +import unittest, rdpy.test.network.type + +def headerTest(name): + print "-"*40 + print name + print "-"*40 + +if __name__ == '__main__': + headerTest("Test case rdpy.test.network.type.TypeCase") + suite = unittest.TestLoader().loadTestsFromTestCase(rdpy.test.network.type.TypeCase) + unittest.TextTestRunner(verbosity=2).run(suite) + diff --git a/rdpy/network/type.py b/rdpy/network/type.py index 4f4559d..1e31c46 100644 --- a/rdpy/network/type.py +++ b/rdpy/network/type.py @@ -563,9 +563,17 @@ class UInt24Be(SimpleType): def __write__(self, s): ''' special write for a special type + @param s: Stream ''' s.write(struct.pack(">I", self.value)[1:]) + def __read__(self, s): + ''' + special read for a special type + @param s: Stream + ''' + self.value = struct.unpack(self._structFormat, '\x00' + s.read(self._typeSize))[0] + class UInt24Le(SimpleType): ''' unsigned int with little endian representation @@ -587,7 +595,14 @@ class UInt24Le(SimpleType): @param s: Stream ''' #don't write first byte - s.write(struct.pack("