<commit_before>import z3
import symbolic_ccall

def main():
    print "Testing amd64_actions_ADD"
    print "(8-bit) 1 + 1...",
    arg_l = z3.BitVecVal(1, 8)
    arg_r = z3.BitVecVal(1, 8)
    ret = symbolic_ccall.amd64_actions_ADD(8, arg_l, arg_r, 0)
    if ret == 0:
        print "PASS"
    else:
        print "FAILED"

    print "(32-bit) (-1) + (-2)...",
    arg_l = z3.BitVecVal(-1, 32)
    arg_r = z3.BitVecVal(-1, 32)
    ret = symbolic_ccall.amd64_actions_ADD(32, arg_l, arg_r, 0)
    if ret == 0b101010:
        print "PASS"
    else:
        print "FAILED"

    print "Testing amd64_actions_SUB"
    print "(8-bit) 1 - 1...",
    arg_l = z3.BitVecVal(1, 8)
    arg_r = z3.BitVecVal(1, 8)
    ret = symbolic_ccall.amd64_actions_SUB(8, arg_l, arg_r, 0)
    if ret == 0b010100:
        print "PASS"
    else:
        print "FAILED"

    print "(32-bit) (-1) - (-2)...",
    arg_l = z3.BitVecVal(-1, 32)
    arg_r = z3.BitVecVal(-1, 32)
    ret = symbolic_ccall.amd64_actions_SUB(32, arg_l, arg_r, 0)
    if ret == 0:
        print "PASS"
    else:
        print "FAILED"


if __name__ == "__main__":
    main()
<commit_msg>Added a call to z3.init() in test_symbolic_ccall.<commit_after>import os
import z3
import symbolic_ccall

def main():
	# init z3
	z3_path = os.environ.get('Z3PATH')
	if z3_path == None:
		z3_path = "/opt/python/lib/"
	try:
		z3.init(z3_path + "libz3.so")
	except:
		print "z3 initialization failed. Please set $Z3PATH accordingly."
		return

	print "Testing amd64_actions_ADD"
	print "(8-bit) 1 + 1...",
	arg_l = z3.BitVecVal(1, 8)
	arg_r = z3.BitVecVal(1, 8)
	ret = symbolic_ccall.amd64_actions_ADD(8, arg_l, arg_r, 0)
	if ret == 0:
	    print "PASS"
	else:
	    print "FAILED"

	print "(32-bit) (-1) + (-2)...",
	arg_l = z3.BitVecVal(-1, 32)
	arg_r = z3.BitVecVal(-1, 32)
	ret = symbolic_ccall.amd64_actions_ADD(32, arg_l, arg_r, 0)
	if ret == 0b101010:
	    print "PASS"
	else:
	    print "FAILED"

	print "Testing amd64_actions_SUB"
	print "(8-bit) 1 - 1...",
	arg_l = z3.BitVecVal(1, 8)
	arg_r = z3.BitVecVal(1, 8)
	ret = symbolic_ccall.amd64_actions_SUB(8, arg_l, arg_r, 0)
	if ret == 0b010100:
	    print "PASS"
	else:
	    print "FAILED"

	print "(32-bit) (-1) - (-2)...",
	arg_l = z3.BitVecVal(-1, 32)
	arg_r = z3.BitVecVal(-1, 32)
	ret = symbolic_ccall.amd64_actions_SUB(32, arg_l, arg_r, 0)
	if ret == 0:
	    print "PASS"
	else:
	    print "FAILED"


if __name__ == "__main__":
	main()

{'fraction_non_alphanumeric': 0.15713698066639242, 'fraction_numerical': 0.0711641299876594, 'mean_word_length': 2.758887171561051, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4403504', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1065, 'n_words': 246}