forked from enlightenment/efl
* src/bin/Makefile.am:
* src/bin/evil_test_gettimeofday.c: fix unit test; now all tests pass, finally * src/lib/evil_unistd.c: fix gettimeofday() on mingw32ce SVN revision: 38130
This commit is contained in:
parent
87ededafe7
commit
55f7df7ef9
|
@ -1,3 +1,12 @@
|
||||||
|
2008-12-13 Vincent Torri <doursse at users dot sf dot net>
|
||||||
|
|
||||||
|
* src/bin/Makefile.am:
|
||||||
|
* src/bin/evil_test_gettimeofday.c:
|
||||||
|
fix unit test; now all tests pass, finally
|
||||||
|
|
||||||
|
* src/lib/evil_unistd.c:
|
||||||
|
fix gettimeofday() on mingw32ce
|
||||||
|
|
||||||
2008-12-13 Vincent Torri <doursse at users dot sf dot net>
|
2008-12-13 Vincent Torri <doursse at users dot sf dot net>
|
||||||
|
|
||||||
* src/bin/Makefile.am:
|
* src/bin/Makefile.am:
|
||||||
|
|
|
@ -30,7 +30,7 @@ evil_suite_SOURCES += memcpy_glibc_arm.S
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
evil_suite_LDADD = $(top_builddir)/src/lib/libevil.la $(top_builddir)/src/lib/dlfcn/libdl.la
|
evil_suite_LDADD = $(top_builddir)/src/lib/libevil.la $(top_builddir)/src/lib/dlfcn/libdl.la -lm
|
||||||
evil_suite_LDFLAGS = -Wl,--enable-auto-import
|
evil_suite_LDFLAGS = -Wl,--enable-auto-import
|
||||||
|
|
||||||
test_pipe_SOURCES = test_pipe.c
|
test_pipe_SOURCES = test_pipe.c
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
#include <Evil.h>
|
#include <Evil.h>
|
||||||
|
|
||||||
|
@ -20,14 +21,13 @@ test_time_tests_run(suite *s)
|
||||||
|
|
||||||
gettimeofday (&tp1, NULL);
|
gettimeofday (&tp1, NULL);
|
||||||
|
|
||||||
Sleep(997);
|
Sleep(1000);
|
||||||
|
|
||||||
gettimeofday (&tp2, NULL);
|
gettimeofday (&tp2, NULL);
|
||||||
|
|
||||||
delta = (double)tp2.tv_sec - tp1.tv_sec + (tp2.tv_usec - tp1.tv_usec) / 1000000.0;
|
delta = (double)(tp2.tv_sec - tp1.tv_sec) + (double)(tp2.tv_usec - tp1.tv_usec) / 1000000.0;
|
||||||
if (delta > 0.005)
|
if (fabs(delta - 1) > 0.005)
|
||||||
{
|
{
|
||||||
printf (" * %f\n", delta);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,11 @@ _evil_systemtime_to_time(SYSTEMTIME st)
|
||||||
int
|
int
|
||||||
evil_gettimeofday(struct timeval *tp, void *tzp __UNUSED__)
|
evil_gettimeofday(struct timeval *tp, void *tzp __UNUSED__)
|
||||||
{
|
{
|
||||||
tp->tv_sec = _evil_time_second;
|
int milli_sec;
|
||||||
tp->tv_usec = (GetTickCount() - _evil_time_millisecond) * 1000;
|
|
||||||
|
milli_sec = (int)GetTickCount() - _evil_time_millisecond;
|
||||||
|
tp->tv_sec = _evil_time_second + milli_sec / 1000;
|
||||||
|
tp->tv_usec = (milli_sec % 1000) * 1000;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue