diff --git a/tests/conftest.py b/tests/conftest.py index 92c599c..8fdfe33 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -11,21 +11,29 @@ from .pfwtest import is_windows_32_bits, is_process_32_bits, test_binary_name, D if is_windows_32_bits: def pop_proc_32(dwCreationFlags=DEFAULT_CREATION_FLAGS): - return windows.utils.create_process(r"C:\Windows\system32\{0}".format(test_binary_name).encode("ascii"), dwCreationFlags=dwCreationFlags, show_windows=True) + p = windows.utils.create_process(r"C:\Windows\system32\{0}".format(test_binary_name).encode("ascii"), dwCreationFlags=dwCreationFlags, show_windows=True) + assert p.bitness == 32 + return p def pop_proc_64(dwCreationFlags=DEFAULT_CREATION_FLAGS): raise WindowsError("Cannot create calc64 in 32bits system") else: def pop_proc_32(dwCreationFlags=DEFAULT_CREATION_FLAGS): - return windows.utils.create_process(r"C:\Windows\syswow64\{0}".format(test_binary_name).encode("ascii"), dwCreationFlags=dwCreationFlags, show_windows=True) + p = windows.utils.create_process(r"C:\Windows\syswow64\{0}".format(test_binary_name).encode("ascii"), dwCreationFlags=dwCreationFlags, show_windows=True) + assert p.bitness == 32 + return p if is_process_32_bits: def pop_proc_64(dwCreationFlags=DEFAULT_CREATION_FLAGS): with windows.utils.DisableWow64FsRedirection(): - return windows.utils.create_process(r"C:\Windows\system32\{0}".format(test_binary_name).encode("ascii"), dwCreationFlags=dwCreationFlags, show_windows=True) + p = windows.utils.create_process(r"C:\Windows\system32\{0}".format(test_binary_name).encode("ascii"), dwCreationFlags=dwCreationFlags, show_windows=True) + assert p.bitness == 64 + return p else: def pop_proc_64(dwCreationFlags=DEFAULT_CREATION_FLAGS): - return windows.utils.create_process(r"C:\Windows\system32\{0}".format(test_binary_name).encode("ascii"), dwCreationFlags=dwCreationFlags, show_windows=True) + p = windows.utils.create_process(r"C:\Windows\system32\{0}".format(test_binary_name).encode("ascii"), dwCreationFlags=dwCreationFlags, show_windows=True) + assert p.bitness == 64 + return p import sys diff --git a/tests/pfwtest.py b/tests/pfwtest.py index 92023b3..2674bdd 100644 --- a/tests/pfwtest.py +++ b/tests/pfwtest.py @@ -28,7 +28,7 @@ require_admin = pytest.mark.skipif(not is_admin, reason="Test must be launched a check_for_gc_garbage = pytest.mark.usefixtures("check_for_gc_garbage") check_for_handle_leak = pytest.mark.usefixtures("check_for_handle_leak") -test_binary_name = "notepad.exe" +test_binary_name = "winver.exe" DEFAULT_CREATION_FLAGS = gdef.CREATE_NEW_CONSOLE