More tests
This commit is contained in:
parent
f8f15172a6
commit
703da620bf
1 changed files with 73 additions and 1 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: lalgarra <lalgarra@student.42madrid.com> +#+ +:+ +#+ */
|
/* By: lalgarra <lalgarra@student.42madrid.com> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/10/15 18:54:32 by lalgarra #+# #+# */
|
/* Created: 2025/10/15 18:54:32 by lalgarra #+# #+# */
|
||||||
/* Updated: 2025/10/21 18:50:51 by lalgarra ### ########.fr */
|
/* Updated: 2025/10/24 20:48:52 by lalgarra ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -453,6 +453,74 @@ static void test24()
|
||||||
ft_printf("ret=%i\n", ret);
|
ft_printf("ret=%i\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test25()
|
||||||
|
{
|
||||||
|
char prefix[128];
|
||||||
|
char sfmt[128];
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
strcpy(prefix, "test25: ");
|
||||||
|
strcpy(sfmt, "%%7.5s,%%7.5s,%%-7.5s,%%-7.5s:%7.5s,%7.5s,%-7.5s,%-7.5s--eof; ");
|
||||||
|
printf("%s printf(): ", prefix);
|
||||||
|
ret = printf(sfmt, "yolo", "bombastic", "yolo", "tubular");
|
||||||
|
printf("ret=%i\n", ret);
|
||||||
|
fflush(stdout);
|
||||||
|
ft_printf("%sft_printf(): ", prefix);
|
||||||
|
ret = ft_printf(sfmt, "yolo", "bombastic", "yolo", "tubular");
|
||||||
|
ft_printf("ret=%i\n", ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test26()
|
||||||
|
{
|
||||||
|
char prefix[128];
|
||||||
|
char sfmt[128];
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
strcpy(prefix, "test26: ");
|
||||||
|
strcpy(sfmt, "%%8.5i,%%10.5i,%%-8.5i,%%-10.5i:%8.5i,%10.5i,%-8.5i,%-10.5i--eof; ");
|
||||||
|
printf("%s printf(): ", prefix);
|
||||||
|
ret = printf(sfmt, 34, -216, 34, -216);
|
||||||
|
printf("ret=%i\n", ret);
|
||||||
|
fflush(stdout);
|
||||||
|
ft_printf("%sft_printf(): ", prefix);
|
||||||
|
ret = ft_printf(sfmt, 34, -216, 34, -216);
|
||||||
|
ft_printf("ret=%i\n", ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test27()
|
||||||
|
{
|
||||||
|
char prefix[128];
|
||||||
|
char sfmt[128];
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
strcpy(prefix, "test27: ");
|
||||||
|
strcpy(sfmt, "%%.03s,%%3.1s:%.03s,%3.1s--eof; ");
|
||||||
|
printf("%s printf(): ", prefix);
|
||||||
|
ret = printf(sfmt, NULL, NULL);
|
||||||
|
printf("ret=%i\n", ret);
|
||||||
|
fflush(stdout);
|
||||||
|
ft_printf("%sft_printf(): ", prefix);
|
||||||
|
ret = ft_printf(sfmt, NULL, NULL);
|
||||||
|
ft_printf("ret=%i\n", ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test28()
|
||||||
|
{
|
||||||
|
char prefix[128];
|
||||||
|
char sfmt[128];
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
strcpy(prefix, "test28: ");
|
||||||
|
strcpy(sfmt, "%%08.5i,%%010.5i,%%.i:%08.5i,%010.5i,%.i--eof; ");
|
||||||
|
printf("%s printf(): ", prefix);
|
||||||
|
ret = printf(sfmt, 34, -216, 0);
|
||||||
|
printf("ret=%i\n", ret);
|
||||||
|
fflush(stdout);
|
||||||
|
ft_printf("%sft_printf(): ", prefix);
|
||||||
|
ret = ft_printf(sfmt, 34, -216, 0);
|
||||||
|
ft_printf("ret=%i\n", ret);
|
||||||
|
}
|
||||||
|
|
||||||
static void test50()
|
static void test50()
|
||||||
{
|
{
|
||||||
char prefix[128];
|
char prefix[128];
|
||||||
|
|
@ -513,6 +581,10 @@ int main(void)
|
||||||
test22();
|
test22();
|
||||||
test23();
|
test23();
|
||||||
test24();
|
test24();
|
||||||
|
test25();
|
||||||
|
test26();
|
||||||
|
test27();
|
||||||
|
test28();
|
||||||
test50();
|
test50();
|
||||||
test99();
|
test99();
|
||||||
return (0);
|
return (0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue