libowfat/test/fmt_long.c

16 lines
324 B
C
Raw Normal View History

2016-03-17 11:13:23 +00:00
#include "fmt.h"
#include "str.h"
2003-05-01 20:40:41 +00:00
#include <assert.h>
2004-11-25 21:52:35 +00:00
int main() {
2003-05-01 20:40:41 +00:00
char buf[1024];
assert(fmt_long(0,12345)==5);
assert(fmt_long(0,-12345)==6);
assert(fmt_long(buf,12345)==5); buf[5]=0;
assert(str_equal(buf,"12345"));
assert(fmt_long(buf,-12345)==6); buf[6]=0;
assert(str_equal(buf,"-12345"));
2004-11-25 21:52:35 +00:00
return 0;
2003-05-01 20:40:41 +00:00
}