summaryrefslogtreecommitdiff
path: root/tests/port/test_strdup.c
blob: 557aa031c51c91f4e02481ca717bfc9a5f5c8503 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "port/sys.h"

#undef HAVE_STRDUP
#include "port/string.c"	/* for strdup */
#undef strdup

#include <stdlib.h>		/* for exit, EXIT_SUCCESS, free */

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;
	free( d );

	exit( res );
}