0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 7.4.2113

Problem:    Test for undo is flaky.
Solution:   Turn it into a new style test.  Use test_settime() to avoid
            flakyness.
This commit is contained in:
Bram Moolenaar
2016-07-29 16:15:27 +02:00
parent b56195ed00
commit 170b10b421
9 changed files with 215 additions and 220 deletions

View File

@@ -534,7 +534,7 @@ u_savecommon(
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 @@ undo_time(
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 @@ u_add_time(char_u *buf, size_t buflen, time_t tt)
#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 @@ u_add_time(char_u *buf, size_t buflen, time_t tt)
else
#endif
vim_snprintf((char *)buf, buflen, _("%ld seconds ago"),
(long)(time(NULL) - tt));
(long)(vim_time() - tt));
}
/*