def tests_strtrim(): tests = "" tests += 'puts("* ft_strtrim");'; for i in range(TESTS_N): tests += "write(1, \"" + str(i) + "\\n\", 3);" tests += "free(ft_strtrim({}, {}));\n".format(inputs.input_string(), inputs.input_string()) return tests
def tests_strtrim(): tests = "" tests += 'puts("* ft_strtrim");' for i in range(TESTS_N): tests += "free(ft_strtrim({}, {}));\n".format(inputs.input_string(), inputs.input_string()) return tests
def tests_mapi(): tests = "" tests += 'puts("* ft_strmapi");' for i in range(TESTS_N): tests += "free(ft_strmapi({}, {}));\n".format(inputs.input_string(), inputs.input_map_func()) return tests
def tests_split(): tests = "" tests += 'puts("* ft_split");' for i in range(TESTS_N): tests += "ft_split({}, {});\n".format(inputs.input_string(), inputs.input_char()) return tests
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_lstnew(): tests = "" tests += 'puts("* ft_lstnew");'; for i in range(TESTS_N): tests += "free(ft_lstnew({}));\n".format(inputs.input_string()) return tests
def tests_putendl(): tests = "" tests += 'puts("* ft_putendl");'; for i in range(TESTS_N): tests += "ft_putendl_fd({}, -1);\n".format(inputs.input_string()) return tests