[0.1.x] updated : intBase tests passed

git-svn-id: https://pykd.svn.codeplex.com/svn@71744 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2011-11-25 07:18:38 +00:00 committed by Mikhail I. Izmestev
parent 664f6e4c69
commit 816827ec9f
8 changed files with 410 additions and 172 deletions

View File

@ -96,84 +96,37 @@ BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( DebugClient_compareMemory, DebugClient::
BOOST_PYTHON_MODULE( pykd )
{
python::class_<intBase>( "intBase", "intBase", python::no_init )
.def( int_( python::self ) )
.def( "__long__", &intBase::convertLong )
.def( python::self + ULONG64() )
.def( ULONG64() + python::self )
.def( python::self += ULONG64() )
.def( python::self + python::self )
.def( python::self += python::self )
.def( python::self - ULONG64() )
.def( ULONG64() - python::self )
.def( python::self -= ULONG64() )
.def( python::self - python::self )
.def( python::self -= python::self )
.def( python::self * ULONG64() )
.def( ULONG64() * python::self )
.def( python::self *= ULONG64() )
.def( python::self * python::self )
.def( python::self *= python::self )
.def( python::self / ULONG64() )
.def( ULONG64() / python::self )
.def( python::self /= ULONG64() )
.def( python::self / python::self )
.def( python::self /= python::self )
.def( python::self % ULONG64() )
.def( ULONG64() % python::self )
.def( python::self %= ULONG64() )
.def( python::self % python::self )
.def( python::self %= python::self )
.def( python::self & ULONG64() )
.def( ULONG64() & python::self )
.def( python::self &= ULONG64() )
.def( python::self & python::self )
.def( python::self &= python::self )
.def( python::self | ULONG64() )
.def( ULONG64() | python::self )
.def( python::self |= ULONG64() )
.def( python::self | python::self )
.def( python::self |= python::self )
.def( python::self ^ ULONG64() )
.def( ULONG64() ^ python::self )
.def( python::self ^= ULONG64() )
.def( python::self ^ python::self )
.def( python::self ^= python::self )
.def( python::self << ULONG64() )
.def( python::self <<= ULONG64() )
.def( python::self >> ULONG64() )
.def( python::self >>= ULONG64() )
.def( python::self < ULONG64() )
.def( python::self < python::self )
.def( python::self <= ULONG64() )
.def( python::self <= python::self )
.def( python::self == ULONG64() )
.def( python::self == boost::python::self )
.def( python::self >= ULONG64() )
.def( python::self >= boost::python::self )
.def( python::self > ULONG64() )
.def( python::self > boost::python::self )
.def( python::self != ULONG64() )
.def( python::self != boost::python::self )
.def( ~boost::python::self )
.def( !boost::python::self )
.def( python::init<python::object&>() )
.def( "__eq__", &intBase::eq )
.def( "__ne__", &intBase::ne)
.def( "__lt__", &intBase::lt)
.def( "__gt__", &intBase::gt )
.def( "__le__", &intBase::le )
.def( "__ge__", &intBase::ge )
.def( "__add__", &intBase::add )
.def( "__radd__", &intBase::add )
.def( "__sub__", &intBase::sub )
.def( "__rsub__", &intBase::rsub )
.def( "__mul__", &intBase::mul )
.def( "__rmul__", &intBase::mul )
.def( "__div__", &intBase::div )
.def( "__rdiv__", &intBase::rdiv )
.def( "__mod__", &intBase::mod )
.def( "__rmod__", &intBase::rmod )
.def( "__rshift__", &intBase::rshift )
.def( "__rrshift__", &intBase::rrshift )
.def( "__lshift__", &intBase::lshift )
.def( "__rlshift__", &intBase::rlshift )
.def( "__and__", &intBase::and )
.def( "__rand__", &intBase::and )
.def( "__or__", &intBase::or )
.def( "__ror__", &intBase::or )
.def( "__xor__", &intBase::xor )
.def( "__rxor__", &intBase::xor )
.def( "__neg__", &intBase::neg )
.def( "__pos__", &intBase::pos )
.def( "__invert__", &intBase::invert )
.def( "__nonzero__", &intBase::nonzero )
.def( "__str__", &intBase::str )
.def( "__hex__", &intBase::hex );
@ -366,11 +319,11 @@ BOOST_PYTHON_MODULE( pykd )
"Wait for events that breaks into the debugger" );
python::class_<TypeInfo, TypeInfoPtr, boost::noncopyable >("typeInfo", "Class representing typeInfo", python::no_init )
.def( "name", &pykd::TypeInfo::getName )
.def( "size", &pykd::TypeInfo::getSize )
.def( "offset", &pykd::TypeInfo::getOffset )
.def( "field", &pykd::TypeInfo::getField )
.def( "__getattr__", &pykd::TypeInfo::getField );
.def( "name", &TypeInfo::getName )
.def( "size", &TypeInfo::getSize )
.def( "offset", &TypeInfo::getOffset )
.def( "field", &TypeInfo::getField )
.def( "__getattr__", &TypeInfo::getField );
python::class_<TypedVar, TypedVarPtr, python::bases<intBase>, boost::noncopyable >("typedVar",
"Class of non-primitive type object, child class of typeClass. Data from target is copied into object instance",

View File

@ -2,92 +2,201 @@
namespace pykd {
class intBase : boost::integer_arithmetic<intBase>
typedef boost::variant<LONG, ULONG, LONG64, ULONG64, bool> BaseTypeVariant;
class VariantToStr : public boost::static_visitor<std::string>
{
public:
template<typename T>
std::string operator()(T i ) const {
std::stringstream sstr;
sstr << i;
return sstr.str();
}
};
class VariantToHex : public boost::static_visitor<std::string>
{
public:
template<typename T>
std::string operator()(T i ) const {
std::stringstream sstr;
sstr << std::hex << i;
return sstr.str();
}
};
class VariantToPyobj : public boost::static_visitor<python::object>
{
public:
template<typename T>
python::object operator()(T i ) const {
return python::object( i );
}
};
class intBase {
public:
operator ULONG64() const {
return getValue();
intBase(python::object &obj) {
m_variant = convertToVar(obj);
}
intBase& operator= ( ULONG64 val ) {
setValue( val );
return *this;
}
intBase() : m_variant(LONG(0))
{}
virtual ULONG64 getValue() const {
return m_intValue;
}
virtual void setValue( ULONG64 value ) {
m_intValue = value;
std::string
str() {
return boost::apply_visitor( VariantToStr(), getValue() );
}
std::string
str() const {
std::stringstream ss;
ss << getValue();
return ss.str();
hex() {
return boost::apply_visitor( VariantToHex(), getValue() );
}
std::string
hex() const {
std::stringstream ss;
ss << std::hex << getValue();
return ss.str();
python::object eq( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) == obj;
}
template <class T>
bool operator!=(T const& rhs)
{ return getValue() == rhs; }
python::object ne( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) != obj;
}
template <class T>
intBase& operator+=(T const& rhs)
{ setValue( getValue() + rhs ); return *this; }
python::object lt( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) < obj;
}
template <class T>
intBase& operator-=(T const& rhs)
{ setValue( getValue() - rhs ); return *this; }
python::object gt( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) > obj;
}
template <class T>
intBase& operator*=(T const& rhs)
{ setValue( getValue() * rhs ); return *this; }
python::object le( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) <= obj;
}
template <class T>
intBase& operator/=(T const& rhs)
{ setValue( getValue() / rhs ); return *this; }
python::object ge( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) >= obj;
}
template <class T>
intBase& operator%=(T const& rhs)
{ setValue( getValue() % rhs ); return *this; }
python::object add( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) + obj;
}
template <class T>
intBase& operator&=(T const& rhs)
{ setValue( getValue() & rhs ); return *this; }
python::object sub( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) - obj;
}
template <class T>
intBase& operator|=(T const& rhs)
{ setValue( getValue() | rhs ); return *this; }
python::object rsub( python::object& obj ) {
return obj - boost::apply_visitor( VariantToPyobj(), getValue() );
}
template <class T>
intBase& operator^=(T const& rhs)
{ setValue( getValue() ^ rhs ); return *this; }
python::object mul( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) * obj;
}
template <class T>
intBase& operator<<=(T const& rhs)
{ setValue( getValue() << rhs ); return *this; }
python::object div( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) / obj;
}
template <class T>
intBase& operator>>=(T const& rhs)
{ setValue( getValue() >> rhs ); return *this; }
python::object rdiv( python::object& obj ) {
return obj / boost::apply_visitor( VariantToPyobj(), getValue() );
}
PyObject* convertLong() { return PyLong_FromLongLong( getValue() ); }
python::object mod( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) % obj;
}
python::object rmod( python::object& obj ) {
return obj % boost::apply_visitor( VariantToPyobj(), getValue() );
}
python::object rshift( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) >> obj;
}
python::object rrshift( python::object& obj ) {
return obj >> boost::apply_visitor( VariantToPyobj(), getValue() );
}
python::object lshift( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) << obj;
}
python::object rlshift( python::object& obj ) {
return obj << boost::apply_visitor( VariantToPyobj(), getValue() );
}
python::object and( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) & obj;
}
python::object or( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) | obj;
}
python::object xor( python::object& obj ) {
return boost::apply_visitor( VariantToPyobj(), getValue() ) ^ obj;
}
python::object neg() {
return 0 - boost::apply_visitor( VariantToPyobj(), getValue() );
}
python::object pos() {
return 0 + boost::apply_visitor( VariantToPyobj(), getValue() );
}
python::object invert() {
return boost::apply_visitor( VariantToPyobj(), getValue() ) ^ boost::apply_visitor( VariantToPyobj(), getValue() );
}
python::object nonzero() {
return boost::apply_visitor( VariantToPyobj(), getValue() ) != 0;
}
private:
ULONG64 m_intValue;
virtual BaseTypeVariant getValue() {
return m_variant;
}
BaseTypeVariant convertToVar( python::object &obj )
{
if ( PyBool_Check( obj.ptr() ) )
{
if ( obj.ptr() == Py_True )
return BaseTypeVariant(true);
return BaseTypeVariant(false);
}
else if ( _PyLong_Sign( obj.ptr() ) >= 0 )
{
if ( PyInt_CheckExact( obj.ptr() ) )
return BaseTypeVariant( ULONG( PyLong_AsUnsignedLong( obj.ptr() ) ) );
else
if( PyLong_CheckExact( obj.ptr() ) )
return BaseTypeVariant( ULONG64( PyLong_AsUnsignedLongLong( obj.ptr() ) ) );
}
else
{
if ( PyInt_CheckExact( obj.ptr() ) )
return BaseTypeVariant( LONG( PyLong_AsLong( obj.ptr() ) ) );
else
if( PyLong_CheckExact( obj.ptr() ) )
return BaseTypeVariant( LONG64( PyLong_AsLongLong( obj.ptr() ) ) );
}
return BaseTypeVariant( false );
}
BaseTypeVariant m_variant;
};
};

View File

@ -51,3 +51,4 @@
namespace python = boost::python;
#include <boost/regex.hpp>
#include <boost/variant.hpp>

View File

@ -51,24 +51,55 @@ TypedVar::TypedVar ( IDebugClient4 *client, const TypeInfoPtr& typeInfo, ULONG64
}
///////////////////////////////////////////////////////////////////////////////////
ULONG64
BasicTypedVar::getValue() const
BaseTypeVariant BasicTypedVar::getValue()
{
HRESULT hres;
ULONG64 val = 0;
HRESULT hres;
hres = m_dataSpaces->ReadVirtual( m_offset, &val, getSize(), NULL );
if ( FAILED( hres ) )
throw MemoryException( m_offset, false );
return val;
if ( m_typeInfo->getName() == "Char" )
return (LONG)*(PCHAR)&val;
if ( m_typeInfo->getName() == "WChar" )
return (LONG)*(PWCHAR)&val;
if ( m_typeInfo->getName() == "Int2B" )
return (LONG)*(PSHORT)&val;
if ( m_typeInfo->getName() == "UInt2B" )
return (ULONG)*(PUSHORT)&val;
if ( m_typeInfo->getName() == "Int4B" )
return *(PLONG)&val;
if ( m_typeInfo->getName() == "UInt4B" )
return *(PULONG)&val;
if ( m_typeInfo->getName() == "Int8B" )
return (LONG64)*(PLONG64)&val;
if ( m_typeInfo->getName() == "UInt8B" )
return (ULONG64)*(PULONG64)&val;
if ( m_typeInfo->getName() == "Long" )
return *(PLONG)&val;
if ( m_typeInfo->getName() == "ULong" )
return *(PULONG)&val;
if ( m_typeInfo->getName() == "Bool" )
return *(bool*)&val;
throw DbgException( "failed get value " );
}
///////////////////////////////////////////////////////////////////////////////////
ULONG64
PtrTypedVar::getValue() const
BaseTypeVariant PtrTypedVar::getValue()
{
HRESULT hres;
ULONG64 val = 0;

View File

@ -59,14 +59,10 @@ protected:
TypedVar ( IDebugClient4 *client, const TypeInfoPtr& typeInfo, ULONG64 offset );
virtual ULONG64 getValue() const {
virtual BaseTypeVariant getValue() {
return m_offset;
}
virtual void setValue( ULONG64 value) {
throw DbgException("can not change");
}
TypeInfoPtr m_typeInfo;
ULONG64 m_offset;
@ -87,7 +83,7 @@ public:
return intBase::str();
}
virtual ULONG64 getValue() const;
virtual BaseTypeVariant getValue();
};
@ -108,7 +104,7 @@ public:
return "PtrTypedVar";
}
virtual ULONG64 getValue() const;
virtual BaseTypeVariant getValue();
};

146
test/scripts/intbase.py Normal file
View File

@ -0,0 +1,146 @@
import unittest
import target
from pykd import intBase
class IntBaseTest( unittest.TestCase ):
def testCtor( self ):
a = intBase(0xFF)
a = intBase(0xFFFF)
a = intBase(0xFFFFFFFF)
a = intBase(0x8000000000000000)
a = intBase(0xFFFFFFFFFFFFFFFF)
a = intBase(-20)
a = intBase(-2000)
a = intBase(-200000)
a = intBase(-20000000000)
a = intBase(-0xFFFFFFFFFFFFFFFF )
a = intBase( True )
def testEq( self ):
self.assertTrue( 0xFF == intBase(0xFF) and intBase(0xFF) == 0xFF )
self.assertTrue( 0xFFFF == intBase(0xFFFF) and 0xFFFF == intBase(0xFFFF) )
self.assertTrue( 0xFFFFFFFF == intBase(0xFFFFFFFF) and intBase(0xFFFFFFFF) == 0xFFFFFFFF )
self.assertTrue( 0x8000000000000000 == intBase(0x8000000000000000) )
self.assertTrue( 0xFFFFFFFFFFFFFFFF == intBase(0xFFFFFFFFFFFFFFFF) )
self.assertTrue( -20 == intBase(-20) )
self.assertTrue( -2000 == intBase(-2000) )
self.assertTrue( -20000000000 == intBase(-20000000000) )
self.assertTrue( -0x8000000000000000 == intBase(-0x8000000000000000) )
self.assertTrue( intBase(0x20L) == intBase(0x20) )
self.assertTrue( True == intBase(True) )
self.assertTrue( False == intBase(0) )
self.assertTrue( True == intBase(1) )
def testNe( self ):
self.assertTrue( 0xFE != intBase(0xFF) )
self.assertTrue( 0xFF00 != intBase(0xFFFF) )
self.assertTrue( 0xFFFFFF88 != intBase(0xFFFFFFFF) )
self.assertTrue( 0x8000000000000000 - 1 != intBase(0x8000000000000000) )
self.assertTrue( 0xFFFFFFFFFFFFFFFF - 1 != intBase(0xFFFFFFFFFFFFFFFF) )
self.assertTrue( -20 + 1 != intBase(-20) )
self.assertTrue( -2000 + 1 != intBase(-2000) )
self.assertTrue( -20000000000 + 1 != intBase(-20000000000) )
self.assertTrue( -0x8000000000000000 - 1 != intBase(-0x8000000000000000) )
def testLtGt( self ):
self.assertTrue( 0xFE < intBase(0xFF) and intBase(0xFE) < 0xFF )
self.assertFalse( -99 < intBase(-100) and intBase(-99) < - 100 )
self.assertTrue( 0xFFFFFFFFFFFFFFFE < intBase(0xFFFFFFFFFFFFFFFF) )
self.assertFalse(0xFFFFFFFFFFFFFFFF < intBase(0xFFFFFFFFFFFFFFFE) )
self.assertTrue( intBase(0xFFFFFFFFFFFFFFFE) < 0xFFFFFFFFFFFFFFFF )
def testLeGe( self ):
self.assertTrue( 0xFE <= intBase(0xFF) and intBase(0xFE) <= 0xFF )
self.assertTrue( 0xFF <= intBase(0xFF) )
self.assertFalse( -99 <= intBase(-100) and intBase(-99) <= - 100 )
self.assertTrue( 0xFFFFFFFFFFFFFFFE <= intBase(0xFFFFFFFFFFFFFFFF) )
self.assertFalse(0xFFFFFFFFFFFFFFFF <= intBase(0xFFFFFFFFFFFFFFFE) )
self.assertTrue( intBase(0xFFFFFFFFFFFFFFFF) <= 0xFFFFFFFFFFFFFFFF )
def testAdd( self ):
self.assertEqual( 10, intBase(5) + 5 )
self.assertEqual( 10, 5 + intBase(5) )
a = 10
a += intBase(10)
self.assertEqual( 20, a )
self.assertEqual( -20, intBase(-10) + (-10) )
self.assertEqual( 10, intBase(-10) + 20 )
self.assertEqual( 0x7fffffffffffffff + 1, intBase(0x7fffffffffffffff) + 1)
self.assertEqual( -0x8000000000000000 + 10, intBase(-0x8000000000000000) + 10 )
self.assertEqual( 0, intBase(-0x8000000000000000) + 0x8000000000000000 )
def testSub( self ):
self.assertEqual( 0, intBase(5) - 5 )
self.assertEqual( 10, 15 - intBase(5) )
a = 10
a -= intBase(5)
self.assertEqual( 5, a )
self.assertEqual( -20, intBase(-10) -10 )
self.assertEqual( -10, 10 - intBase(20) )
self.assertEqual( -0xFFFFFFFF - 1, intBase(-0xFFFFFFFF) - 1 )
def testMul( self ):
self.assertEqual( 4, intBase(2) * 2 )
self.assertEqual( 4, 2 * intBase(2) )
self.assertEqual( -4, 2 * intBase(-2) )
self.assertEqual( 4, -2 * intBase(-2) )
self.assertEqual( 0x7fffffffffffffff * 2, intBase(0x7fffffffffffffff) * 2)
self.assertEqual( 0x80000000*2, intBase(0x80000000)*2 )
self.assertEqual( -0x80000000*2, 2 * intBase(-0x80000000))
def testDiv( self ):
self.assertEqual( 1, intBase(2) / 2 )
self.assertEqual( 2, 5 / intBase(2) )
self.assertEqual( -1, 2 / intBase(-2) )
self.assertEqual( 1, -2 / intBase(-2) )
try:
-2 / intBase(0)
self.assertTrue( False )
except ZeroDivisionError:
self.assertTrue( True )
try:
intBase(2)/0
self.assertTrue( False )
except ZeroDivisionError:
self.assertTrue( True )
def testMod( self ):
self.assertEqual( 1, intBase(3) % 2 )
self.assertEqual( 0, intBase(3) % 3 )
self.assertEqual( 1, 3 % intBase(2) )
self.assertEqual( 0, 3 % intBase(3) )
def testShift( self ):
self.assertEqual( 0xFFFFFFFF >> 8, intBase(0xFFFFFFFF) >> 8 )
self.assertEqual( 0x00FFFFFF << 8, intBase(0x00FFFFFF) << 8 )
self.assertEqual( 0xFFFFFFFF >> 8, 0xFFFFFFFF >> intBase(8) )
self.assertEqual( 0x00FFFFFF << 8, 0x00FFFFFF << intBase(8) )
def testAnd( self ):
self.assertEqual( 0xFFFFFFFF & 0xFFFF, intBase(0xFFFFFFFF) & 0xFFFF )
self.assertEqual( 0xFFFFFFFF & 0xFFFF, 0xFFFFFFFF & intBase(0xFFFF) )
self.assertEqual( -0xFFFFFFFF & 0xFFFF, intBase(-0xFFFFFFFF) & 0xFFFF )
self.assertEqual( -0xFFFFFFFF & 0xFFFF, -0xFFFFFFFF & intBase(0xFFFF) )
def testOr( self ):
self.assertEqual( 0xFFFF0000 | 0xFFFF, intBase(0xFFFF0000) | 0xFFFF )
self.assertEqual( 0xFFFF0000 | 0xFFFF, 0xFFFF0000 | intBase(0xFFFF) )
self.assertEqual( -0xFFFF0000 | 0xFFFF, intBase(-0xFFFF0000) | 0xFFFF )
self.assertEqual( -0xFFFF0000 | 0xFFFF, -0xFFFF0000 | intBase(0xFFFF) )
def testXor( self ):
self.assertEqual( 0xFFFFFFFF ^ 0xFFFF, intBase(0xFFFFFFFF) ^ 0xFFFF )
self.assertEqual( 0xFFFFFFFF ^ 0xFFFF, 0xFFFFFFFF ^ intBase(0xFFFF) )
self.assertEqual( -0xFFFFFFFF ^ 0xFFFF, intBase(-0xFFFFFFFF) ^ 0xFFFF )
self.assertEqual( -0xFFFFFFFF ^ 0xFFFF, -0xFFFFFFFF ^ intBase(0xFFFF) )
def testUnary( self ):
self.assertEqual( -0xFFFFFFFF, -intBase(0xFFFFFFFF) )
self.assertEqual( 0xFFFFFFFF, +intBase(0xFFFFFFFF) )
self.assertEqual( 0, ~intBase(0xFFFFFFFF) )

View File

@ -21,6 +21,7 @@ import clienttest
import eventtest
import typedvar
import memtest
import intbase
def getTestSuite( singleName = "" ):
if singleName == "":
@ -34,6 +35,7 @@ def getTestSuite( singleName = "" ):
unittest.TestLoader().loadTestsFromTestCase( clienttest.DbgClientTest ),
unittest.TestLoader().loadTestsFromTestCase( eventtest.EventTest ),
unittest.TestLoader().loadTestsFromTestCase( memtest.MemoryTest ),
unittest.TestLoader().loadTestsFromTestCase( intbase.IntBaseTest ),
] )
else:
return unittest.TestSuite( unittest.TestLoader().loadTestsFromName( singleName ) )
@ -52,7 +54,7 @@ if __name__ == "__main__":
target.module.reload();
suite = getTestSuite()
#suite = getTestSuite( "typedvar.TypedVarTest" )
#suite = getTestSuite( "typedvar.TypedVarTest.testStruct" )
unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run( suite )

View File

@ -52,14 +52,14 @@ class TypedVarTest( unittest.TestCase ):
self.assertEqual( 0, tv.m_arrayField[0] )
self.assertEqual( 2, tv.m_arrayField[1] )
self.assertEqual( 3, tv.m_noArrayField )
self.assertNotEqual( -1, long(tv.m_arrayField[0]) )
self.assertNotEqual( -1, tv.m_arrayField[0] )
self.assertNotEqual( 0, tv.m_noArrayField )
def testGlobalVar(self):
self.assertEqual( 4, target.module.typedVar( "g_ulongValue" ) )
self.assertEqual( 0x80000000, target.module.typedVar( "ulongArray" )[3] )
self.assertEqual( 0x8000000000000000, target.module.typedVar( "ulonglongArray" )[3] )
self.assertEqual( -100000, int(target.module.typedVar( "longArray" )[3]) )
self.assertEqual( -10000000000, long(target.module.typedVar( "longlongArray" )[4]) )
self.assertEqual( -100000, target.module.typedVar( "longArray" )[3])
self.assertEqual( -10000000000, target.module.typedVar( "longlongArray" )[4])
self.assertEqual( target.module.g_structTest, target.module.typedVar( "g_structTestPtr" ) )