GithubHelp home page GithubHelp logo

cacharle / ft_printf_test Goto Github PK

View Code? Open in Web Editor NEW
22.0 2.0 1.0 788 KB

ft_printf test

Home Page: https://git.cacharle.xyz/ft_printf_test

License: GNU General Public License v3.0

Makefile 0.96% C 93.49% Python 4.72% Objective-C 0.83%
ft-printf ft-printf42 printf-tests printf-tester bonus

ft_printf_test's Introduction

ft_printf test

Unit test for the ft_printf project of 42 school.

screenshot

Usage

Clone this repo such that:

`
|- ft_printf_test/
|- ft_printf/

or modify the FT_PRINTF_PATH variable in the Makefile

  • > make run: run the tests in a pretty format
  • > make verbose: to show a more verbose output
  • > make quiet: to show a more quiet output
  • > make raw: run the tests in a ugly but parsable format
  • > python3 prettier -h: show prettier options
  • > make generate: generate 100 random test

Bonus

All the previous make command suffixed with bonus (i.e make runbonus). You may need to make fclean in order to clean the previous .o files.

Random Test Generator

It will generate random test according to the -Wformat flag of gcc.

  • > ./generate -n [number of tests]: generate n test
  • > ./generate -h: show all available options

Bonus

Add the --bonus flag i.e: > python3 generate.py -n [number of tests] --bonus.

Memory leaks check

You have to install valgrind with brew, here is a nice thread to install it locally if you don't have root access. You can then run > brew install valgrind.

  • > make check_leaks: run valgrind on a test (without the test themself).
  • > make check_leaks_verbose: add --leak-check=full to valgrind.

Credits

ft_printf_test's People

Contributors

cacharle avatar ykoh42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

xicodomingues

ft_printf_test's Issues

tests ft_printf("%-5c", '\0') & ft_printf("{%3c}", 0)

Hello
In my results when I execute the following code
in a single main my result is: printf("%-5c", '\0') --> " " (4 blanks)
in your code you get the following result: printf("%-5c", '\0') --> "" (No blanks)

The same for
in a simple main program I get: printf("{%3c}", 0)-->"{ }"(1 bracket & 2 blanks & 1 braket)
in your code you get the following result: printf("{%3c}", 0)-->"{ " (1 bracket & 2 blanks)

In my opinion, for any reason I can't explain, those results you get are not OK.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.