summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-02-11 12:24:21 -0800
committerEdward Thomson <ethomson@github.com>2016-02-12 10:34:15 -0800
commit35439f5997c41d0c50d58997c2167ee93aad6c30 (patch)
tree131598ee3fa2374d4010828fc0407568fe80e0f8 /tests
parent263e674ec6701b774d8f464150a9d30650c6da46 (diff)
downloadlibgit2-35439f5997c41d0c50d58997c2167ee93aad6c30.tar.gz
win32: introduce p_timeval that isn't stupid
Windows defines `timeval` with `long`, which we cannot sanely cope with. Instead, use a custom timeval struct.
Diffstat (limited to 'tests')
-rw-r--r--tests/checkout/checkout_helpers.c2
-rw-r--r--tests/core/posix.c2
-rw-r--r--tests/diff/workdir.c4
-rw-r--r--tests/index/racy.c2
-rw-r--r--tests/merge/workdir/dirty.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/tests/checkout/checkout_helpers.c b/tests/checkout/checkout_helpers.c
index fb2f415e7..d7d24f33f 100644
--- a/tests/checkout/checkout_helpers.c
+++ b/tests/checkout/checkout_helpers.c
@@ -133,7 +133,7 @@ int checkout_count_callback(
void tick_index(git_index *index)
{
struct timespec ts;
- struct timeval times[2];
+ struct p_timeval times[2];
cl_assert(index->on_disk);
cl_assert(git_index_path(index));
diff --git a/tests/core/posix.c b/tests/core/posix.c
index 5a9e24899..34a67bf47 100644
--- a/tests/core/posix.c
+++ b/tests/core/posix.c
@@ -100,7 +100,7 @@ void test_core_posix__inet_pton(void)
void test_core_posix__utimes(void)
{
- struct timeval times[2];
+ struct p_timeval times[2];
struct stat st;
time_t curtime;
int fd;
diff --git a/tests/diff/workdir.c b/tests/diff/workdir.c
index 4c782339d..892c7b72d 100644
--- a/tests/diff/workdir.c
+++ b/tests/diff/workdir.c
@@ -1755,7 +1755,7 @@ void test_diff_workdir__with_stale_index(void)
static int touch_file(void *payload, git_buf *path)
{
struct stat st;
- struct timeval times[2];
+ struct p_timeval times[2];
GIT_UNUSED(payload);
if (git_path_isdir(path->ptr))
@@ -2006,7 +2006,7 @@ void test_diff_workdir__only_writes_index_when_necessary(void)
git_oid initial, first, second;
git_buf path = GIT_BUF_INIT;
struct stat st;
- struct timeval times[2];
+ struct p_timeval times[2];
opts.flags |= GIT_DIFF_INCLUDE_UNTRACKED | GIT_DIFF_UPDATE_INDEX;
diff --git a/tests/index/racy.c b/tests/index/racy.c
index e2275ea14..ace84d585 100644
--- a/tests/index/racy.c
+++ b/tests/index/racy.c
@@ -54,7 +54,7 @@ void test_index_racy__write_index_just_after_file(void)
git_index *index;
git_diff *diff;
git_buf path = GIT_BUF_INIT;
- struct timeval times[2];
+ struct p_timeval times[2];
/* Make sure we do have a timestamp */
cl_git_pass(git_repository_index(&index, g_repo));
diff --git a/tests/merge/workdir/dirty.c b/tests/merge/workdir/dirty.c
index 994a1d813..99e33e0cd 100644
--- a/tests/merge/workdir/dirty.c
+++ b/tests/merge/workdir/dirty.c
@@ -133,7 +133,7 @@ static void hack_index(char *files[])
struct stat statbuf;
git_buf path = GIT_BUF_INIT;
git_index_entry *entry;
- struct timeval times[2];
+ struct p_timeval times[2];
time_t now;
size_t i;