{
entry_func_t entry_func;
char *entry_name;
+ size_t tmp;
if(argc < 2) {
fprintf(stderr, "Pass servername as first argument\n");
entry_name = argv[1];
entry_func = NULL;
- {
- size_t tmp;
- for(tmp = 0; tmp < CURL_ARRAYSIZE(s_entries); ++tmp) {
- if(strcmp(entry_name, s_entries[tmp].name) == 0) {
- entry_func = s_entries[tmp].ptr;
- break;
- }
+ for(tmp = 0; tmp < CURL_ARRAYSIZE(s_entries); ++tmp) {
+ if(strcmp(entry_name, s_entries[tmp].name) == 0) {
+ entry_func = s_entries[tmp].ptr;
+ break;
}
}
return 99;
}
- --argc;
- ++argv;
-
- return entry_func(argc, argv);
+ return entry_func(argc - 1, argv + 1);
}
#include "a libcurl header.h" /* from the lib dir */
- static CURLcode unit_setup( void )
+ static CURLcode t9999_setup(void)
{
/* whatever you want done first */
return CURLE_OK;
}
- static void unit_stop( void )
+ static void t9999_stop(void)
{
/* done before shutting down and exiting */
}
static CURLcode test_unit9999(char *arg)
{
- UNITTEST_BEGIN(unit_setup())
+ UNITTEST_BEGIN(t9999_setup())
/* here you start doing things and checking that the results are good */
/* you end the test code like this: */
- UNITTEST_END(unit_stop())
+ UNITTEST_END(t9999_stop())
}
~~~
} \
} while(0)
-#define verify_memory(dynamic, check, len) \
- do { \
- if(dynamic && memcmp(dynamic, check, len)) { \
- curl_mfprintf(stderr, "%s:%d Memory buffer FAILED match size %d. " \
- "'%s' is not\n", __FILE__, __LINE__, len, \
- hexdump((const unsigned char *)check, len)); \
+#define verify_memory(dynamic, check, len) \
+ do { \
+ if(dynamic && memcmp(dynamic, check, len)) { \
+ curl_mfprintf(stderr, "%s:%d Memory buffer FAILED match size %d. " \
+ "'%s' is not\n", __FILE__, __LINE__, len, \
+ hexdump((const unsigned char *)check, len)); \
curl_mfprintf(stderr, "%s:%d the same as '%s'\n", __FILE__, __LINE__, \
- hexdump((const unsigned char *)dynamic, len)); \
- unitfail++; \
- } \
+ hexdump((const unsigned char *)dynamic, len)); \
+ unitfail++; \
+ } \
} while(0)
/* fail() is for when the test case figured out by itself that a check