This project has been created as part of the 42 curriculum by kjurkows
IT IS NOT NORM COMPLIANT
ft_printf-test is a testing suite for ft_printf. Used for testing all formatters and flags using gtest (Google Test).
See Detailed description for list of tests.
- clone your
ft_printfintoft_printffolder - In
Makefile, setFT_PRINTF_INCto the path of yourft_printf/includefolder (or any other folder withft_printf.hin it)
./test.sh./test.sh bonusImportant
All AI code was used after careful analysis.
Gemini was used while deciding what flags to test with a given formatter.
AI inline suggestions were used for repetitive tasks, such as:
- Writing
#includes - Rewriting tests for different formatters (using existing tests from another formatter as a template)
Tip
gtest might ignore % in test names
Most tests focus around one formatter/flag
All tests for bonus are suffixed _bonus
Bellow is the list of all tests:
| Name | Description |
|---|---|
norme |
Norm check |
| Name | Description |
|---|---|
basic |
No formatter |
invalid |
Invalid formatter |
| Name | What is checked |
|---|---|
basic |
simple character |
align_right1 |
min-width number |
align_left1 |
- flag+number |
less_width1 |
0 |
| Name | What is checked |
|---|---|
basic |
simple string |
null |
nullptr |
align_right1 |
min-width number |
align_left1 |
- flag+number |
less_width1 |
%5s |
precision1 |
. flag+numbers |
null_precision1 |
NULL with . |
| Name | What is checked |
|---|---|
basic |
simple pointer |
null |
nullptr |
minmax |
min/max pointer |
align_right1 |
min-width number |
align_left1 |
- flag+number |
less_width1 |
%2p |
precision1 |
. flag+numbers |
01 |
0 flag+number |
plus_space1 |
+/ flags |
ignored1 |
0./-0/+- |
mixed1 |
% -020.10p |
null_precision1 |
NULL with . |
| Name | What is checked |
|---|---|
basic |
simple integer |
minmax |
min/max integer |
align_right1 |
min-width number |
align_left1 |
- flag+number |
less_width1 |
%1d/%1i |
precision1 |
. flag+numbers |
01 |
0 flag+number |
plus_space1 |
+/ flags |
ignored1 |
0./-0/+- |
mixed1 |
% -020.10d/% -020.10i |
value01 |
0 value with . |
| Name | What is checked |
|---|---|
basic |
simple unsigned integer |
minmax |
min/max unsigned integer |
align_right1 |
min-width number |
align_left1 |
- flag+number |
less_width1 |
%1u |
precision1 |
. flag+numbers |
01 |
0 flag+number |
plus_space1 |
+/ flags |
ignored1 |
0./-0/+- |
mixed1 |
% -020.10u |
value01 |
0 value with . |
| Name | What is checked |
|---|---|
basic |
simple hexadecimal |
minmax |
min/max hexadecimal |
align_right1 |
min-width number |
align_left1 |
- flag+number |
less_width1 |
%1x/%1X |
precision1 |
. flag+numbers |
hash1 |
# flag+number |
01 |
0 flag+number |
plus_space1 |
+/ flags |
ignored1 |
0./-0/+- |
mixed1 |
% -020.10x/% -020.10X |
value01 |
0 value with . |
| Name | What is checked |
|---|---|
basic |
%% |
width1 |
min-width number |