alelievr / libft-unit-test

457 stars 88 forks source link

ft_putchar #37

Closed atenagm closed 6 years ago

atenagm commented 6 years ago

it is not possible to print unicode with function putchar

alelievr commented 6 years ago

Hello,

It is possible with your ft_putchar to print unicode, anyway this test is displayed as a KO and not a FAIL so your function works even if this test does not pass.

amalliar commented 4 years ago

Actually, it's not possible due to a size limitation of 1 byte integer types: the value gets truncated automatically when you pass a big enough int into a function that expects a char. So, unless you know of some magical way to detect overflows on passed parameters, I'd suggest removing this test to avoid further confusion.

On a side note: this test also displays diffs incorrectly:

Diffs:
  putchar_fd: |ø|    <-- output of ft_putchar_fd()
ft_putchar_fd: |ø|    <-- expected output
alelievr commented 4 years ago

@amalliar They changed the subject so it's actually not possible anymore as the new prototype takes a char (was taking an int before).

Therefore, I suppose i'll remove the test.