[0.1.x] fixed : typedVar can not be used as a key for map

git-svn-id: https://pykd.svn.codeplex.com/svn@72761 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2011-12-29 14:25:17 +00:00 committed by Mikhail I. Izmestev
parent 2d141abec2
commit 670659121b
2 changed files with 12 additions and 1 deletions

View File

@ -133,7 +133,8 @@ BOOST_PYTHON_MODULE( pykd )
.def( "__hex__", &intBase::hex )
.def( "__long__", &intBase::long_ )
.def( "__int__", &intBase::int_ )
.def( "__index__", &intBase::long_ );
.def( "__index__", &intBase::long_ )
.def( "__hash__", &intBase::long_ );
python::class_<DebugClient, DebugClientPtr>("dbgClient", "Class representing a debugging session", python::no_init )
.def( "addr64", &DebugClient::addr64,

View File

@ -131,5 +131,15 @@ class TypedVarTest( unittest.TestCase ):
ind = target.module.typedVar( "g_ucharValue" )
self.assertEqual( 5, [0,5,10][ind] )
self.assertTrue( ind in [0,1,2] )
tv = target.module.typedVar( "g_struct3" )
self.assertEqual( 2, tv.m_arrayField[ind] )
ind = target.module.typedVar( "g_ulongValue" )
self.assertEqual( 4, ind )
self.assertTrue( ind in { 1 : "1", 4 : "2" } )
self.assertEqual( "2", { 1 : "1", 4 : "2" }[ind] )