mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[0.2.x] + test case for workitem 11723
git-svn-id: https://pykd.svn.codeplex.com/svn@83440 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
b4442b7383
commit
0aec1a092c
28
test/scripts/mspdbtest.py
Normal file
28
test/scripts/mspdbtest.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""Public microsoft symbols tests"""
|
||||
|
||||
import unittest
|
||||
import pykd
|
||||
import os
|
||||
|
||||
class PeFileAsDumpLoader:
|
||||
"""Load/unload PE-file from System as crash dump file"""
|
||||
def __init__(self, fileName):
|
||||
self._fileName = fileName
|
||||
self._loaded = False
|
||||
|
||||
def __enter__(self):
|
||||
pykd.loadDump(self._fileName)
|
||||
self._loaded = True
|
||||
|
||||
def __exit__(self, exc_type, exc_value, exc_tb):
|
||||
if self._loaded:
|
||||
pykd.detachProcess()
|
||||
self._loaded = False
|
||||
|
||||
class MsPdbTest(unittest.TestCase):
|
||||
"""Public Microsoft symbols tests"""
|
||||
|
||||
def testFindMethodOffset(self):
|
||||
"""Lookup method offset by name"""
|
||||
with PeFileAsDumpLoader( os.environ["WINDIR"] + r"\System32\ole32.dll" ) as loadedDump:
|
||||
self.assertNotEqual( 0, pykd.getOffset("ole32!CPackagerMoniker::AddRef") )
|
@ -16,9 +16,10 @@ import target
|
||||
import intbase
|
||||
import memtest
|
||||
import moduletest
|
||||
import typeinfo
|
||||
import typeinfo
|
||||
import typedvar
|
||||
import regtest
|
||||
import mspdbtest
|
||||
import localstest
|
||||
import customtypestest
|
||||
import ehexcepttest
|
||||
@ -53,6 +54,7 @@ def getTestSuite( singleName = "" ):
|
||||
# ^^^
|
||||
unittest.TestLoader().loadTestsFromTestCase( TerminateProcessTest ),
|
||||
|
||||
unittest.TestLoader().loadTestsFromTestCase( mspdbtest.MsPdbTest ),
|
||||
unittest.TestLoader().loadTestsFromTestCase( localstest.LocalVarsTest ),
|
||||
unittest.TestLoader().loadTestsFromTestCase( ehexcepttest.EhExceptionTest ),
|
||||
unittest.TestLoader().loadTestsFromTestCase( ehstatustest.EhStatusTest ),
|
||||
|
@ -609,6 +609,10 @@
|
||||
RelativePath="..\scripts\moduletest.py"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\mspdbtest.py"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\pykdtest.py"
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user