summaryrefslogtreecommitdiff
path: root/tests/libc/test_itoa.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-07-13 20:09:53 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-07-13 20:09:53 +0200
commit7d356b1ddab0150b7347a5952e3bff2a04704fd4 (patch)
treec26a5b9c45d970dda011f9923966233a4f70669b /tests/libc/test_itoa.c
parent7162c5eed91a8e22a4b768110011df28bfd86455 (diff)
downloadabaos-7d356b1ddab0150b7347a5952e3bff2a04704fd4.tar.gz
abaos-7d356b1ddab0150b7347a5952e3bff2a04704fd4.tar.bz2
added an exit function
added Linux syscall stubs for exit and write adapted all tests added a printf test made stdio work on Linux or AbaOs syscalls
Diffstat (limited to 'tests/libc/test_itoa.c')
-rw-r--r--tests/libc/test_itoa.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/libc/test_itoa.c b/tests/libc/test_itoa.c
index 837b77a..837fd01 100644
--- a/tests/libc/test_itoa.c
+++ b/tests/libc/test_itoa.c
@@ -9,26 +9,26 @@ int main( void )
// simple conversion without sign
res = itoa( 568876, buf, 10 );
- if( strcmp( buf, "568876" ) ) return 1;
+ if( strcmp( buf, "568876" ) ) exit( 1 );
// test if the returned pointer points to the buffer
- if( strcmp( res, buf ) ) return 1;
+ if( strcmp( res, buf ) ) exit( 1 );
// conversion with sign
res = itoa( -568876, buf, 10 );
- if( strcmp( buf, "-568876" ) ) return 1;
+ if( strcmp( buf, "-568876" ) ) exit( 1 );
// convert upper limit
res = itoa( INT_MAX, buf, 10 );
- if( strcmp( buf, "2147483647" ) ) return 1;
+ if( strcmp( buf, "2147483647" ) ) exit( 1 );
// convert lower limit
res = itoa( INT_MIN+1, buf, 10 );
- if( strcmp( buf, "-2147483647" ) ) return 1;
+ if( strcmp( buf, "-2147483647" ) ) exit( 1 );
// convert to hex
res = itoa( 568876, buf, 16 );
- if( strcmp( buf, "8AE2C" ) ) return 1;
+ if( strcmp( buf, "8AE2C" ) ) exit( 1 );
- return 0;
+ exit( 0 );
}