Nothing to see here

This commit is contained in:
2023-08-22 23:14:13 +03:00
parent 0f9928b611
commit 2d212866ec
28 changed files with 735 additions and 76 deletions

BIN
proven-point/tests/a Executable file

Binary file not shown.

View File

@@ -0,0 +1,17 @@
#include "../main.h"
#include <stdio.h>
/**
*main - ensure append work
*/
int main(void)
{
char *str, c;
str = "hello";
c = 'c';
str = append(str, c);
_printf("%s\n", str);
return (0);
}

View File

@@ -0,0 +1,15 @@
#include "../main.h"
/**
* main - testing printing of only char
*
* Return: deadth
*/
int main(void)
{
char c = 97;
_printf("cat: %css\noh wait is that...a %%\n", c);
return (0);
}

View File

@@ -0,0 +1,44 @@
#include "../main.h"
#include <limits.h>
#include <stdio.h>
/**
* main - Entry point
*
* Return: Always 0
*/
int main(void)
{
int len;
int len2;
unsigned int ui;
void *addr;
len = _printf("Let's try to printf a simple sentence.\n");
len2 = printf("Let's try to printf a simple sentence.\n");
ui = (unsigned int)INT_MAX + 1024;
addr = (void *)0x7ffe637541f0;
_printf("Length:[%d, %i]\n", len, len);
printf("Length:[%d, %i]\n", len2, len2);
_printf("Negative:[%d]\n", -762534);
printf("Negative:[%d]\n", -762534);
_printf("Unsigned:[%u]\n", ui);
printf("Unsigned:[%u]\n", ui);
_printf("Unsigned octal:[%o]\n", ui);
printf("Unsigned octal:[%o]\n", ui);
_printf("Unsigned hexadecimal:[%x, %X]\n", ui, ui);
printf("Unsigned hexadecimal:[%x, %X]\n", ui, ui);
_printf("Character:[%c]\n", 'H');
printf("Character:[%c]\n", 'H');
_printf("String:[%s]\n", "I am a string !");
printf("String:[%s]\n", "I am a string !");
_printf("Address:[%p]\n", addr);
printf("Address:[%p]\n", addr);
len = _printf("Percent:[%%]\n");
len2 = printf("Percent:[%%]\n");
_printf("Len:[%d]\n", len);
printf("Len:[%d]\n", len2);
_printf("Unknown:[%r]\n");
printf("Unknown:[%r]\n");
return (0);
}

View File

@@ -0,0 +1,13 @@
#include "../main.h"
/**
* main - Hello world
*
* Return: always 0
**/
int main(void)
{
int len;
len = _printf("Hello world\n");
return (len);
}

13
proven-point/tests/itoa.c Normal file
View File

@@ -0,0 +1,13 @@
#include "../main.h"
#define shit 0
/**
* main - check if this works
*/
int main(void)
{
char *str;
str = _itoa(10, 2);
_printf("%s", str);
return (shit);
}

View File

@@ -0,0 +1,14 @@
#include "../main.h"
#define shit 0
#define fr ;
/**
* main - no cap fr %d
*
*/
int main(void)
{
_printf("the number is: %d\n", 10)fr
_printf("the binary is: %b\n", 10)fr
_printf("the cursed i thing is: %i\n", 011);
return (shit)fr
}

12
proven-point/tests/puts.c Normal file
View File

@@ -0,0 +1,12 @@
#include "../main.h"
/**
* main - puts works?
*/
int main(void)
{
char *str;
str = "hello\n";
_puts(str);
return (0);
}

View File

@@ -0,0 +1,20 @@
#include "../main.h"
#include <string.h>
/**
* main - Tests if '%s' works within our printf.
*
* Return: 0 On Failure, 1 Otherwise Success
*/
int main(void)
{
char *test_0 = "Hej";
char *test_1 = "pls";
/*
* Brain ded to think bout test cond
*/
_printf(" suh %s\n%s\n", test_0, test_1);
return (0);
}

View File

@@ -0,0 +1,21 @@
#include "../main.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
/**
* main - why does this not work! I know!
* Return: 0...unless?
*/
int main(void)
{
char *str, *str2, c;
str = "hello";
str2 = " world!\n";
str = _strcpy(str, str2);
c = 'c';
printf("%s", str);
write(1, &c, 1);
return (0);
}

View File

@@ -0,0 +1,19 @@
#include "../main.h"
/**
* main - test strlen
* Return: 0 if yes, 1 if no
*/
int main(void)
{
char *str;
int len;
str = "hello";
len =_strlen(str);
if (len == 5)
return (0);
else
return (1);
}

3
proven-point/tests/test.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/bash
gcc -Wno-format -Wall -pedantic -Werror -Wextra -std=gnu89 $1 ../*.c -o a
./a