# Path: mozz/test.py
# def run_test_module(name, file):
# 	outputfile = mozz.util.python_path_basename(file) + '.out'
# 
# 	m = sys.modules[name]
# 	ldr = unittest.loader.defaultTestLoader
# 	tests = ldr.loadTestsFromModule(m)
# 
# 	with open(outputfile, 'w') as f:
# 		duper = mozz.util.IOWriteDuplicator(
# 			sys.stderr, f
# 		)
# 		unittest.runner.TextTestRunner(
# 			verbosity = 2,
# 			stream = duper
# 		).run(tests)
# 
# def abs_path(base_file, rel_path):
# 	return os.path.join(
# 		os.path.dirname(os.path.abspath(base_file)),
# 		rel_path
# 	)
# 
# Path: mozz/abi/call.py
# def native_convention():
# 	import mozz.system
# 	mach = mozz.system.architecture()
# 	if mach == mozz.system.ARCH_X86_64:
# 		return X8664SYSVConvention
# 	elif mach == mozz.system.ARCH_X86:
# 		return X86SYSVConvention
# 
# 	raise NativeConventionUnknown("no calling convention " + \
# 									"known for machine type: " + \
# 									repr(mach))


import unittest
import mozz
import mozz.system
from mozz.test import run_test_module, abs_path
from mozz.prototype import *
from mozz.abi.call import native_convention
			{	'a': 72,
				'b': 72,
				'c': 9374,
				'd': 1038,
				'e': 43879,
				'buf1': "asdf",
				'buf2': "qwer"
			}
		]

		if n >= 3:
			return False

		map = {'a': a, 'b': b, 'c': c, 'd': d, 'e': e}
		for (k,v) in map.items():
			if not (expected_params[n][k] == v.value()):
				return False

		map = {'buf1': buf1, 'buf2': buf2}
		for (k,v) in map.items():
			if expected_params[n][k] != v.string(host):
				return False

		return True

	def test_trace_function(self):
		arch = mozz.system.architecture()
		if arch != mozz.system.ARCH_X86_64:
			return #this test not yet supported on non x86_64 systems


# Path: mozz/test.py
# def run_test_module(name, file):
# 	outputfile = mozz.util.python_path_basename(file) + '.out'
# 
# 	m = sys.modules[name]
# 	ldr = unittest.loader.defaultTestLoader
# 	tests = ldr.loadTestsFromModule(m)
# 
# 	with open(outputfile, 'w') as f:
# 		duper = mozz.util.IOWriteDuplicator(
# 			sys.stderr, f
# 		)
# 		unittest.runner.TextTestRunner(
# 			verbosity = 2,
# 			stream = duper
# 		).run(tests)
# 
# def abs_path(base_file, rel_path):
# 	return os.path.join(
# 		os.path.dirname(os.path.abspath(base_file)),
# 		rel_path
# 	)
# 
# Path: mozz/abi/call.py
# def native_convention():
# 	import mozz.system
# 	mach = mozz.system.architecture()
# 	if mach == mozz.system.ARCH_X86_64:
# 		return X8664SYSVConvention
# 	elif mach == mozz.system.ARCH_X86:
# 		return X86SYSVConvention
# 
# 	raise NativeConventionUnknown("no calling convention " + \
# 									"known for machine type: " + \
# 									repr(mach))


# Path: test/function_test.py
import unittest
import mozz
import mozz.system
from mozz.test import run_test_module, abs_path
from mozz.prototype import *
from mozz.abi.call import native_convention

			{	'a': 72,
				'b': 72,
				'c': 9374,
				'd': 1038,
				'e': 43879,
				'buf1': "asdf",
				'buf2': "qwer"
			}
		]

		if n >= 3:
			return False

		map = {'a': a, 'b': b, 'c': c, 'd': d, 'e': e}
		for (k,v) in map.items():
			if not (expected_params[n][k] == v.value()):
				return False

		map = {'buf1': buf1, 'buf2': buf2}
		for (k,v) in map.items():
			if expected_params[n][k] != v.string(host):
				return False

		return True

	def test_trace_function(self):
		arch = mozz.system.architecture()
		if arch != mozz.system.ARCH_X86_64:
			return #this test not yet supported on non x86_64 systems


		s = mozz.Session(abs_path(__file__, "function_test.bin"))