Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as part of the 42 curriculum by kjurkows

ft_printf-test

IT IS NOT NORM COMPLIANT

Description

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.

Instructions

Before testing

  1. clone your ft_printf into ft_printf folder
  2. In Makefile, set FT_PRINTF_INC to the path of your ft_printf/include folder (or any other folder with ft_printf.h in it)

Testing mandatory part

./test.sh

Testing bonus part

./test.sh bonus

Resources

AI Usage

Important

All AI code was used after careful analysis.

Google Gemini

Gemini was used while deciding what flags to test with a given formatter.

GitHub Copilot

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)

Detailed description

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:

Norminette

Name Description
norme Norm check

string

Name Description
basic No formatter
invalid Invalid formatter

%c (c)

Name What is checked
basic simple character
align_right1 min-width number
align_left1 - flag+number
less_width1 0

%s (s)

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 .

%p (p)

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 .

%d/%i (di)

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 .

%u (u)

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 .

%x/%X (x)

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 .

%% (percent)

Name What is checked
basic %%
width1 min-width number

Footnotes

  1. Bonus tests 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

About

Tests fot `ft_printf`

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages