diff --git a/holberton.h b/holberton.h index 5d751f6..eafd1e6 100644 --- a/holberton.h +++ b/holberton.h @@ -14,5 +14,6 @@ typedef struct printer int _putchar(char c); +int _printf(const char *format, ...); #endif diff --git a/printf.c b/printf.c index a4117c2..fe4b8d3 100644 --- a/printf.c +++ b/printf.c @@ -1,4 +1,3 @@ -#include /* for testing only */ #include /* va_list, va_start, va_arg, va_end macros */ #include /* NULL macro */ #include "holberton.h" /* _putchar */ @@ -77,26 +76,3 @@ int _printf(const char *format, ...) return (count); } -/* TODO: REMOVE BEFORE PUSHING TO MASTER! */ -/** - * main - tests _printf against stdio::printf - * Return: 0 on SUCCESS - */ -int main(void) -{ - int a, b; - - a = printf("a\n"); - b = _printf("a\n"); - printf("(%d, %d)\n", a, b); - - a = printf("%c\n", 'A'); - b = _printf("%c\n", 'A'); - printf("(%d, %d)\n", a, b); - - a = printf("%s\n", "Holberton"); - b = _printf("%s\n", "Holberton"); - printf("(%d, %d)\n", a, b); - - return (0); -} diff --git a/tests/small_tests.c b/tests/small_tests.c new file mode 100644 index 0000000..c0e1ff8 --- /dev/null +++ b/tests/small_tests.c @@ -0,0 +1,25 @@ +#include +#include "../holberton.h" + +/** + * main - tests _printf against stdio::printf + * Return: 0 on SUCCESS + */ +int main(void) +{ + int a, b; + + a = printf("a\n"); + b = _printf("a\n"); + printf("(%d, %d)\n", a, b); + + a = printf("%c\n", 'A'); + b = _printf("%c\n", 'A'); + printf("(%d, %d)\n", a, b); + + a = printf("%s\n", "Holberton"); + b = _printf("%s\n", "Holberton"); + printf("(%d, %d)\n", a, b); + + return (0); +}