1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-13 11:04:27 -05:00
libkernaux/tests/test_itoa.c

38 lines
650 B
C
Raw Normal View History

2021-12-15 05:45:40 -05:00
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <kernaux/itoa.h>
#include <assert.h>
#include <string.h>
int main()
{
{
char buffer[10];
kernaux_itoa(495, buffer, 'd');
assert(buffer[0] == '4');
assert(buffer[1] == '9');
assert(buffer[2] == '5');
assert(buffer[3] == '\0');
}
{
char buffer[10];
kernaux_itoa(-7012, buffer, 'd');
assert(buffer[0] == '-');
assert(buffer[1] == '7');
assert(buffer[2] == '0');
assert(buffer[3] == '1');
assert(buffer[4] == '2');
assert(buffer[5] == '\0');
}
return 0;
}