summaryrefslogtreecommitdiff
path: root/tests/port/test_strdup.c
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-02-22 19:21:48 +0100
committerAndreas Baumann <abaumann@yahoo.com>2009-02-22 19:21:48 +0100
commit7da6a6353bd0e93da3be913345777de96589adda (patch)
treef1a4a2bcd2622f6328896456a9972f32b6b7b239 /tests/port/test_strdup.c
parent72fc4fc728f28306afe74cc6d4d6f2e345aea67b (diff)
downloadwolfbones-7da6a6353bd0e93da3be913345777de96589adda.tar.gz
wolfbones-7da6a6353bd0e93da3be913345777de96589adda.tar.bz2
fixed all porting tests (compile always with both versions, the one of the platform and the stub)
Diffstat (limited to 'tests/port/test_strdup.c')
-rw-r--r--tests/port/test_strdup.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/port/test_strdup.c b/tests/port/test_strdup.c
index 557aa03..1853404 100644
--- a/tests/port/test_strdup.c
+++ b/tests/port/test_strdup.c
@@ -8,11 +8,13 @@
int main( void ) {
const char *s = "test";
- int res = EXIT_SUCCESS;
- char *d = wolf_port_strdup( s );
-
- if( strcmp( s, d ) != 0 ) res = EXIT_FAILURE;
+ char *d = strdup( s );
+ char *d2 = wolf_port_strdup( s );
+
+ if( strcmp( s, d ) != 0 ) return EXIT_FAILURE;
+ if( strcmp( d, d2 ) != 0 ) return EXIT_FAILURE;
free( d );
+ free( d2 );
- exit( res );
+ return EXIT_SUCCESS;
}