Exemple #1
0
int main(int argc, char **argv)
{
	int i, j, k = 1;

#ifdef _WIN32
	gg_win32_init_network();
	gg_win32_hook(gethostbyname, my_gethostbyname, NULL);
	gg_win32_hook(connect, my_connect, &connect_hook);
#else
	setbuf(stdout, NULL);
	setbuf(stderr, NULL);
#endif

	gg_debug_level = 255;

	printf("*** TEST %d ***\n\n", k++);
	if (!test_set_get()) {
		printf("*** TEST FAILED ***\n");
		exit(1);
	}
	printf("\n");

	for (i = GG_RESOLVER_DEFAULT; i <= GG_RESOLVER_WIN32; i++) {
		if (i == GG_RESOLVER_CUSTOM)
			continue;
#ifndef GG_CONFIG_HAVE_FORK
		if (i == GG_RESOLVER_FORK)
			continue;
#endif
#ifndef GG_CONFIG_HAVE_PTHREAD
		if (i == GG_RESOLVER_PTHREAD)
			continue;
#endif
#ifndef _WIN32
		if (i == GG_RESOLVER_WIN32)
			continue;
#endif

		for (j = 0; j < 2; j++) {
			printf("*** TEST %d (resolver %d) ***\n\n", k++, i);

			if (!test(i, j)) {
				printf("*** TEST FAILED ***\n");
				exit(1);
			}

			printf("\n");
		}
	}

	return 0;
}
int main(void) {
	assert(R_Type_BytesAllocated == 0);
	test_set_get();
	test_append_bytes();
	test_int_float_string();
	test_getSubString();
	test_setHex();
	test_json_formatting();
	test_shift();
	test_trim();
	test_split();
	test_base64();
	test_puts();
	test_is_same();

	assert(R_Type_BytesAllocated == 0);
	printf("Pass\n");
}
Exemple #3
0
void test_hash_table(void)
{
    test_set_get();
    test_remove();
    test_resize();
}