Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests code updated for build with MS Visual Studio #49

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/libtest/lib1501.c
Expand Up @@ -98,13 +98,13 @@ int test(char *URL)
abort_on_test_timeout();

fprintf(stderr, "ping\n");
gettimeofday(&before, 0);
before = tutil_tvnow();

multi_perform(mhandle, &still_running);

abort_on_test_timeout();

gettimeofday(&after, 0);
after = tutil_tvnow();
e = elapsed(&before, &after);
fprintf(stderr, "pong = %d\n", e);

Expand Down
5 changes: 2 additions & 3 deletions tests/libtest/lib582.c
Expand Up @@ -133,7 +133,7 @@ static int curlTimerCallback(CURLM *multi, long timeout_ms, void *userp)

(void)multi; /* unused */
if (timeout_ms != -1) {
gettimeofday(timeout, 0);
*timeout = tutil_tvnow();
timeout->tv_usec += timeout_ms * 1000;
}
else {
Expand Down Expand Up @@ -173,8 +173,7 @@ static int getMicroSecondTimeout(struct timeval* timeout)
{
struct timeval now;
ssize_t result;

gettimeofday(&now, 0);
now = tutil_tvnow();
result = (timeout->tv_sec - now.tv_sec) * 1000000 +
timeout->tv_usec - now.tv_usec;
if (result < 0)
Expand Down
8 changes: 4 additions & 4 deletions tests/libtest/libauthretry.c
Expand Up @@ -25,7 +25,7 @@
*/

#include "test.h"

#include "strequal.h"
#include "memdebug.h"

static int send_request(CURL *curl, const char *url, int seq,
Expand Down Expand Up @@ -72,11 +72,11 @@ static long parse_auth_name(const char *arg)
{
if (!arg)
return CURLAUTH_NONE;
if (strcasecmp(arg, "basic") == 0)
if (strequal(arg, "basic") == 0)
return CURLAUTH_BASIC;
if (strcasecmp(arg, "digest") == 0)
if (strequal(arg, "digest") == 0)
return CURLAUTH_DIGEST;
if (strcasecmp(arg, "ntlm") == 0)
if (strequal(arg, "ntlm") == 0)
return CURLAUTH_NTLM;
return CURLAUTH_NONE;
}
Expand Down
3 changes: 3 additions & 0 deletions tests/libtest/testtrace.c
Expand Up @@ -22,6 +22,9 @@

#include "test.h"

#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>

#include "testutil.h"
#include "testtrace.h"
#include "memdebug.h"
Expand Down