wininet: status_string clean up.
This commit is contained in:
parent
923498da03
commit
680f251220
|
@ -62,14 +62,14 @@ static BOOL first_connection_to_test_url = TRUE;
|
||||||
if (!expect[status] && !optional[status] && wine_allow[status]) \
|
if (!expect[status] && !optional[status] && wine_allow[status]) \
|
||||||
{ \
|
{ \
|
||||||
todo_wine ok(expect[status], "unexpected status %d (%s)\n", status, \
|
todo_wine ok(expect[status], "unexpected status %d (%s)\n", status, \
|
||||||
status < MAX_INTERNET_STATUS && status_string[status][0] != 0 ? \
|
status < MAX_INTERNET_STATUS && status_string[status] ? \
|
||||||
status_string[status] : "unknown"); \
|
status_string[status] : "unknown"); \
|
||||||
wine_allow[status]--; \
|
wine_allow[status]--; \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
ok(expect[status] || optional[status], "unexpected status %d (%s)\n", status, \
|
ok(expect[status] || optional[status], "unexpected status %d (%s)\n", status, \
|
||||||
status < MAX_INTERNET_STATUS && status_string[status][0] != 0 ? \
|
status < MAX_INTERNET_STATUS && status_string[status] ? \
|
||||||
status_string[status] : "unknown"); \
|
status_string[status] : "unknown"); \
|
||||||
if (expect[status]) expect[status]--; \
|
if (expect[status]) expect[status]--; \
|
||||||
else optional[status]--; \
|
else optional[status]--; \
|
||||||
|
@ -86,7 +86,7 @@ static BOOL first_connection_to_test_url = TRUE;
|
||||||
do { \
|
do { \
|
||||||
ok(notified[status] + optional[status] == (num), \
|
ok(notified[status] + optional[status] == (num), \
|
||||||
"expected status %d (%s) %d times, received %d times\n", \
|
"expected status %d (%s) %d times, received %d times\n", \
|
||||||
status, status < MAX_INTERNET_STATUS && status_string[status][0] != 0 ? \
|
status, status < MAX_INTERNET_STATUS && status_string[status] ? \
|
||||||
status_string[status] : "unknown", (num), notified[status]); \
|
status_string[status] : "unknown", (num), notified[status]); \
|
||||||
CLEAR_NOTIFIED(status); \
|
CLEAR_NOTIFIED(status); \
|
||||||
}while(0)
|
}while(0)
|
||||||
|
@ -98,10 +98,9 @@ static BOOL first_connection_to_test_url = TRUE;
|
||||||
CHECK_NOTIFIED2(status, 0)
|
CHECK_NOTIFIED2(status, 0)
|
||||||
|
|
||||||
#define MAX_INTERNET_STATUS (INTERNET_STATUS_COOKIE_HISTORY+1)
|
#define MAX_INTERNET_STATUS (INTERNET_STATUS_COOKIE_HISTORY+1)
|
||||||
#define MAX_STATUS_NAME 50
|
|
||||||
static int expect[MAX_INTERNET_STATUS], optional[MAX_INTERNET_STATUS],
|
static int expect[MAX_INTERNET_STATUS], optional[MAX_INTERNET_STATUS],
|
||||||
wine_allow[MAX_INTERNET_STATUS], notified[MAX_INTERNET_STATUS];
|
wine_allow[MAX_INTERNET_STATUS], notified[MAX_INTERNET_STATUS];
|
||||||
static CHAR status_string[MAX_INTERNET_STATUS][MAX_STATUS_NAME];
|
static const char *status_string[MAX_INTERNET_STATUS];
|
||||||
|
|
||||||
static HANDLE hCompleteEvent;
|
static HANDLE hCompleteEvent;
|
||||||
|
|
||||||
|
@ -3246,11 +3245,6 @@ static void test_InternetCloseHandle(void)
|
||||||
closetest_req, res, GetLastError());
|
closetest_req, res, GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
#define STATUS_STRING(status) \
|
|
||||||
memcpy(status_string[status], #status, sizeof(CHAR) * \
|
|
||||||
(strlen(#status) < MAX_STATUS_NAME ? \
|
|
||||||
strlen(#status) : \
|
|
||||||
MAX_STATUS_NAME - 1))
|
|
||||||
static void init_status_tests(void)
|
static void init_status_tests(void)
|
||||||
{
|
{
|
||||||
memset(expect, 0, sizeof(expect));
|
memset(expect, 0, sizeof(expect));
|
||||||
|
@ -3258,6 +3252,8 @@ static void init_status_tests(void)
|
||||||
memset(wine_allow, 0, sizeof(wine_allow));
|
memset(wine_allow, 0, sizeof(wine_allow));
|
||||||
memset(notified, 0, sizeof(notified));
|
memset(notified, 0, sizeof(notified));
|
||||||
memset(status_string, 0, sizeof(status_string));
|
memset(status_string, 0, sizeof(status_string));
|
||||||
|
|
||||||
|
#define STATUS_STRING(status) status_string[status] = #status
|
||||||
STATUS_STRING(INTERNET_STATUS_RESOLVING_NAME);
|
STATUS_STRING(INTERNET_STATUS_RESOLVING_NAME);
|
||||||
STATUS_STRING(INTERNET_STATUS_NAME_RESOLVED);
|
STATUS_STRING(INTERNET_STATUS_NAME_RESOLVED);
|
||||||
STATUS_STRING(INTERNET_STATUS_CONNECTING_TO_SERVER);
|
STATUS_STRING(INTERNET_STATUS_CONNECTING_TO_SERVER);
|
||||||
|
@ -3284,8 +3280,8 @@ static void init_status_tests(void)
|
||||||
STATUS_STRING(INTERNET_STATUS_P3P_HEADER);
|
STATUS_STRING(INTERNET_STATUS_P3P_HEADER);
|
||||||
STATUS_STRING(INTERNET_STATUS_P3P_POLICYREF);
|
STATUS_STRING(INTERNET_STATUS_P3P_POLICYREF);
|
||||||
STATUS_STRING(INTERNET_STATUS_COOKIE_HISTORY);
|
STATUS_STRING(INTERNET_STATUS_COOKIE_HISTORY);
|
||||||
}
|
|
||||||
#undef STATUS_STRING
|
#undef STATUS_STRING
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(http)
|
START_TEST(http)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue