def fill_prototype(s, list=None, pointer=None, pointer_size=0): while ("<string>" in s): s = s.replace("<string>", inputs.input_string(), 1) while ("<uint>" in s): s = s.replace("<uint>", inputs.input_uint(), 1) while ("<int>" in s): s = s.replace("<int>", inputs.input_int(), 1) while ("<char>" in s): s = s.replace("<char>", inputs.input_char(), 1) while ("<map_func>" in s): s = s.replace("<map_func>", inputs.input_map_func(), 1) while ("<del_func>" in s): s = s.replace("<del_func>", inputs.input_del_func(), 1) while ("<lstmap_func>" in s): s = s.replace("<lstmap_func>", inputs.input_lstmap_func(), 1) while ("<elem>" in s): s = s.replace("<elem>", inputs.input_elem(), 1) while ("<list>" in s): s = s.replace("<list>", "list{}".format(list), 1) while ("<pointer>" in s): s = s.replace("<pointer>", "ptr{}".format(pointer), 1) while ("<pointer_size>" in s): s = s.replace("<pointer_size>", str(pointer_size), 1) while ("<suint>" in s): s = s.replace("<suint>", inputs.input_short_uint(), 1) return s
def tests_lstdelone(): tests = "" tests += 'puts("* ft_lstdelone");' for i in range(TESTS_N): tests += "ft_lstdelone({}, {});\n".format(inputs.input_elem(), inputs.input_del_func()) return tests
def tests_lstiter(): tests = "" tests += 'puts("* ft_lstiter");'; for i in range(TESTS_N): nb = random.randint(0, 10000000000) tests += inputs.create_list(nb) tests += "ft_lstiter(list{}, {});\n".format(nb, inputs.input_del_func()) return tests