Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions holberton.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ typedef struct printer


int _putchar(char c);
int _printf(const char *format, ...);

#endif
24 changes: 0 additions & 24 deletions printf.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <stdio.h> /* for testing only */
#include <stdarg.h> /* va_list, va_start, va_arg, va_end macros */
#include <stdlib.h> /* NULL macro */
#include "holberton.h" /* _putchar */
Expand Down Expand Up @@ -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);
}
25 changes: 25 additions & 0 deletions tests/small_tests.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <stdio.h>
#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);
}