diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-07-29 16:15:27 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-07-29 16:15:27 +0200 |
commit | 170b10b421f0c9fda08b7cfd3bb043c064f3659a (patch) | |
tree | 31940a6dd764f664f7c6886f0d3645b67754b60a /src/undo.c | |
parent | b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8 (diff) | |
download | vim-git-170b10b421f0c9fda08b7cfd3bb043c064f3659a.tar.gz |
patch 7.4.2113v7.4.2113
Problem: Test for undo is flaky.
Solution: Turn it into a new style test. Use test_settime() to avoid
flakyness.
Diffstat (limited to 'src/undo.c')
-rw-r--r-- | src/undo.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/undo.c b/src/undo.c index 71e62a199..bb5c73da2 100644 --- a/src/undo.c +++ b/src/undo.c @@ -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)); } /* |