Deleted Added
full compact
test_option_a.c (318482) test_option_a.c (348607)
1/*-
2 * Copyright (c) 2003-2008 Tim Kientzle
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25#include "test.h"
26#if defined(HAVE_UTIME_H)
27#include <utime.h>
28#elif defined(HAVE_SYS_UTIME_H)
29#include <sys/utime.h>
30#endif
1/*-
2 * Copyright (c) 2003-2008 Tim Kientzle
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25#include "test.h"
26#if defined(HAVE_UTIME_H)
27#include <utime.h>
28#elif defined(HAVE_SYS_UTIME_H)
29#include <sys/utime.h>
30#endif
31__FBSDID("$FreeBSD: stable/11/contrib/libarchive/cpio/test/test_option_a.c 318482 2017-05-18 19:47:43Z mm $");
31__FBSDID("$FreeBSD: stable/11/contrib/libarchive/cpio/test/test_option_a.c 348607 2019-06-04 10:35:54Z mm $");
32
33static struct {
34 const char *name;
35 time_t atime_sec;
36} files[] = {
37 { "f0", 0 },
38 { "f1", 0 },
39 { "f2", 0 },

--- 26 unchanged lines hidden (view full) ---

66 * makes the tests below rather pointless.
67 */
68 assertMakeFile(files[i].name, 0644, "a");
69
70 /* If utime() isn't supported on your platform, just
71 * #ifdef this section out. Most of the test below is
72 * still valid. */
73 memset(&times, 0, sizeof(times));
32
33static struct {
34 const char *name;
35 time_t atime_sec;
36} files[] = {
37 { "f0", 0 },
38 { "f1", 0 },
39 { "f2", 0 },

--- 26 unchanged lines hidden (view full) ---

66 * makes the tests below rather pointless.
67 */
68 assertMakeFile(files[i].name, 0644, "a");
69
70 /* If utime() isn't supported on your platform, just
71 * #ifdef this section out. Most of the test below is
72 * still valid. */
73 memset(&times, 0, sizeof(times));
74#if defined(_WIN32) && !defined(CYGWIN)
75 times.actime = 86400;
76 times.modtime = 86400;
77#else
74 times.actime = 1;
75 times.modtime = 3;
78 times.actime = 1;
79 times.modtime = 3;
80#endif
76 assertEqualInt(0, utime(files[i].name, &times));
77
78 /* Record whatever atime the file ended up with. */
79 /* If utime() is available, this should be 1, but there's
80 * no harm in being careful. */
81 assertEqualInt(0, stat(files[i].name, &st));
82 files[i].atime_sec = st.st_atime;
83 }

--- 72 unchanged lines hidden ---
81 assertEqualInt(0, utime(files[i].name, &times));
82
83 /* Record whatever atime the file ended up with. */
84 /* If utime() is available, this should be 1, but there's
85 * no harm in being careful. */
86 assertEqualInt(0, stat(files[i].name, &st));
87 files[i].atime_sec = st.st_atime;
88 }

--- 72 unchanged lines hidden ---