~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to gnulib-tests/test-utimens.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- buffer-read-only: t -*- vi: set ro: */
2
 
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3
1
/* Test of file timestamp modification functions.
4
 
   Copyright (C) 2009-2011 Free Software Foundation, Inc.
 
2
   Copyright (C) 2009-2012 Free Software Foundation, Inc.
5
3
 
6
4
   This program is free software: you can redistribute it and/or modify
7
5
   it under the terms of the GNU General Public License as published by
40
38
  ASSERT (stat (BASE "file", &st2) == 0);
41
39
  ASSERT (0 <= utimecmp (BASE "file", &st2, &st1, UTIMECMP_TRUNCATE_SOURCE));
42
40
  if (check_ctime)
43
 
    ASSERT (st1.st_ctime < st2.st_ctime
44
 
            || (st1.st_ctime == st2.st_ctime
45
 
                && get_stat_ctime_ns (&st1) < get_stat_ctime_ns (&st2)));
 
41
    ASSERT (ctime_compare (&st1, &st2) < 0);
46
42
  {
47
43
    /* On some NFS systems, the 'now' timestamp of creat or a NULL
48
44
       timespec is determined by the server, but the 'now' timestamp
104
100
    ASSERT (0 <= get_stat_mtime_ns (&st2));
105
101
    ASSERT (get_stat_mtime_ns (&st2) < BILLION);
106
102
    if (check_ctime)
107
 
      ASSERT (st1.st_ctime < st2.st_ctime
108
 
              || (st1.st_ctime == st2.st_ctime
109
 
                  && get_stat_ctime_ns (&st1) < get_stat_ctime_ns (&st2)));
 
103
      ASSERT (ctime_compare (&st1, &st2) < 0);
110
104
  }
111
105
 
112
106
  /* Play with UTIME_OMIT, UTIME_NOW.  */
122
116
    /* See comment above about this utimecmp call.  */
123
117
    ASSERT (0 <= utimecmp (BASE "file", &st3, &st1, UTIMECMP_TRUNCATE_SOURCE));
124
118
    if (check_ctime)
125
 
      ASSERT (st2.st_ctime < st3.st_ctime
126
 
              || (st2.st_ctime == st3.st_ctime
127
 
                  && get_stat_ctime_ns (&st2) < get_stat_ctime_ns (&st3)));
 
119
      ASSERT (ctime_compare (&st2, &st3) < 0);
128
120
    nap ();
129
121
    ts[0].tv_nsec = 0;
130
122
    ts[1].tv_nsec = UTIME_OMIT;
135
127
    ASSERT (st3.st_mtime == st2.st_mtime);
136
128
    ASSERT (get_stat_mtime_ns (&st3) == get_stat_mtime_ns (&st2));
137
129
    if (check_ctime)
138
 
      ASSERT (st3.st_ctime < st2.st_ctime
139
 
              || (st3.st_ctime == st2.st_ctime
140
 
                  && get_stat_ctime_ns (&st3) < get_stat_ctime_ns (&st2)));
 
130
      ASSERT (ctime_compare (&st3, &st2) < 0);
141
131
  }
142
132
 
143
133
  /* Make sure this dereferences symlinks.  */