patch 7.4.2113
Problem: Test for undo is flaky.
Solution: Turn it into a new style test. Use test_settime() to avoid
flakyness.
diff --git a/src/undo.c b/src/undo.c
index 71e62a1..bb5c73d 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -534,7 +534,7 @@
uhp->uh_seq = ++curbuf->b_u_seq_last;
curbuf->b_u_seq_cur = uhp->uh_seq;
- uhp->uh_time = time(NULL);
+ uhp->uh_time = vim_time();
uhp->uh_save_nr = 0;
curbuf->b_u_time_cur = uhp->uh_time + 1;
@@ -2350,7 +2350,7 @@
else
{
if (dosec)
- closest = (long)(time(NULL) - starttime + 1);
+ closest = (long)(vim_time() - starttime + 1);
else if (dofile)
closest = curbuf->b_u_save_nr_last + 2;
else
@@ -3104,10 +3104,10 @@
#ifdef HAVE_STRFTIME
struct tm *curtime;
- if (time(NULL) - tt >= 100)
+ if (vim_time() - tt >= 100)
{
curtime = localtime(&tt);
- if (time(NULL) - tt < (60L * 60L * 12L))
+ if (vim_time() - tt < (60L * 60L * 12L))
/* within 12 hours */
(void)strftime((char *)buf, buflen, "%H:%M:%S", curtime);
else
@@ -3117,7 +3117,7 @@
else
#endif
vim_snprintf((char *)buf, buflen, _("%ld seconds ago"),
- (long)(time(NULL) - tt));
+ (long)(vim_time() - tt));
}
/*