int main(int argc, char const** argv) { t_unit unit; D_UNIT(init)(&unit); D_UNIT(add_context)(&unit, "Method", 0, 0); F_UNIT_ADD_TEST(&unit, "Method", ret_val); D_UNIT(console_run)(&unit); D_UNIT(destroy)(&unit); (void)argc; (void)argv; return (0); }
int main(int argc, char const** argv) { t_unit unit; D_UNIT(init)(&unit); D_UNIT(add_context)(&unit, "Leaks", 0, 0); D_UNIT(add_test)(&unit, "Leaks", memleaks); D_UNIT(console_run)(&unit); D_UNIT(destroy)(&unit); (void)argc; (void)argv; return (0); }
void D_UNIT_FUNCT(memleaks) { unsigned int i; t_stack stack; i = 0; D_STACK(init)(&stack, 0); while (i < 5000) { D_UNIT(assert)(D_STACK(push)(&stack, 0) == true); i = i + 1; } D_UNIT(assert)(D_STACK(size)(&stack) == 5000); D_STACK(destroy)(&stack); }
int main(int argc, char const** argv) { t_unit unit; /* * disable travis test */ return (0); /* * Initialize unit for that work */ D_UNIT(init)(&unit); /* * Here I add lot of things and I don't check return values * Because I'm warrior */ /* * Add context make box where after you put test */ D_UNIT(add_context)(&unit, "String test", 0, 0); D_UNIT(add_context)(&unit, "Integer test", 0, 0); /* * It's time to push */ F_UNIT_ADD_TEST(&unit, "Integer test", integer); F_UNIT_ADD_TEST(&unit, "Integer test", integer2); F_UNIT_ADD_TEST(&unit, "String test", string2); F_UNIT_ADD_TEST(&unit, "String test", string); /* * Are you ready for ASCII art */ D_UNIT(console_run)(&unit); /* * Good bye memory */ D_UNIT(destroy)(&unit); (void)argc; (void)argv; return (0); }