# Path: haystack/outputters/text.py
# class RecursiveTextOutputter(Outputter):
#     def parse(self, obj, prefix='', depth=10, addr_was=None):
#     def _attrToString(self, attr, field, attrtype, prefix, addr, depth=-1):
# 
# Path: haystack/mappings/folder.py
# MMAP_HACK_ACTIVE = True
# MAX_MAPPING_SIZE_FOR_MMAP = 1024 * 1024 * 20
# class LazyLoadingException(Exception):
# class MemoryDumpLoader(interfaces.IMemoryLoader):
# class ProcessMemoryDumpLoader(MemoryDumpLoader):
# class LazyProcessMemoryDumpLoader(ProcessMemoryDumpLoader):
# class VeryLazyProcessMemoryDumpLoader(LazyProcessMemoryDumpLoader):
# class FolderLoader(interfaces.IMemoryLoader):
#     def __init__(self, filename):
#     def __init__(self, dumpname, bits=None, os_name=None):
#     def make_memory_handler(self):
#     def _is_valid(self):
#     def _load_mappings(self):
#     def _is_valid(self):
#     def _test_dir(self):
#     def _protected_open_file(self, mmap_fname, mmap_pathname):
#     def _load_mappings(self):
#     def _load_metadata(self):
#     def _load_memory_mappings(self):
#     def __init__(self, dumpname, maps_to_load=None, bits=None, os_name=None):
#     def _protected_open_file(self, mmap_fname, mmap_pathname):
#     def _load_memory_mappings(self):
# def load(dumpname, bits=None, os_name=None):
#     def __init__(self, opts):
#     def make_memory_handler(self):


import logging
import unittest
from haystack.outputters import text
from haystack.mappings import folder
from test.testfiles import zeus_1668_vmtoolsd_exe
log = logging.getLogger('testwinxpheap')



class TestWinXPHeapValidator(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        cls._memory_handler = folder.load(zeus_1668_vmtoolsd_exe.dumpname)
        cls._utils = cls._memory_handler.get_target_platform().get_target_ctypes_utils()
        return

    @classmethod
    def tearDownClass(cls):
        cls._utils = None
        cls._memory_handler.reset_mappings()
        cls._memory_handler = None
        return

    def setUp(self):
        self._heap_finder = self._memory_handler.get_heap_finder()
        self.parser = text.RecursiveTextOutputter(self._memory_handler)
        return

    def tearDown(self):
        self._heap_finder = None
        self.parser = None
        return

    @unittest.skip('freelists 0,1,2 indexes are not related to the size of the free chunks. See docs.')

# Path: haystack/outputters/text.py
# class RecursiveTextOutputter(Outputter):
#     def parse(self, obj, prefix='', depth=10, addr_was=None):
#     def _attrToString(self, attr, field, attrtype, prefix, addr, depth=-1):
# 
# Path: haystack/mappings/folder.py
# MMAP_HACK_ACTIVE = True
# MAX_MAPPING_SIZE_FOR_MMAP = 1024 * 1024 * 20
# class LazyLoadingException(Exception):
# class MemoryDumpLoader(interfaces.IMemoryLoader):
# class ProcessMemoryDumpLoader(MemoryDumpLoader):
# class LazyProcessMemoryDumpLoader(ProcessMemoryDumpLoader):
# class VeryLazyProcessMemoryDumpLoader(LazyProcessMemoryDumpLoader):
# class FolderLoader(interfaces.IMemoryLoader):
#     def __init__(self, filename):
#     def __init__(self, dumpname, bits=None, os_name=None):
#     def make_memory_handler(self):
#     def _is_valid(self):
#     def _load_mappings(self):
#     def _is_valid(self):
#     def _test_dir(self):
#     def _protected_open_file(self, mmap_fname, mmap_pathname):
#     def _load_mappings(self):
#     def _load_metadata(self):
#     def _load_memory_mappings(self):
#     def __init__(self, dumpname, maps_to_load=None, bits=None, os_name=None):
#     def _protected_open_file(self, mmap_fname, mmap_pathname):
#     def _load_memory_mappings(self):
# def load(dumpname, bits=None, os_name=None):
#     def __init__(self, opts):
#     def make_memory_handler(self):


# Path: test/haystack/allocators/win32/test_winxpheap.py
import logging
import unittest
from haystack.outputters import text
from haystack.mappings import folder
from test.testfiles import zeus_1668_vmtoolsd_exe

log = logging.getLogger('testwinxpheap')



class TestWinXPHeapValidator(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        cls._memory_handler = folder.load(zeus_1668_vmtoolsd_exe.dumpname)
        cls._utils = cls._memory_handler.get_target_platform().get_target_ctypes_utils()
        return

    @classmethod
    def tearDownClass(cls):
        cls._utils = None
        cls._memory_handler.reset_mappings()
        cls._memory_handler = None
        return

    def setUp(self):
        self._heap_finder = self._memory_handler.get_heap_finder()
        self.parser = text.RecursiveTextOutputter(self._memory_handler)
        return

    def tearDown(self):
        self._heap_finder = None
        self.parser = None
        return

    @unittest.skip('freelists 0,1,2 indexes are not related to the size of the free chunks. See docs.')

    def test_get_freelists(self):