summaryrefslogtreecommitdiff
path: root/cpio
diff options
context:
space:
mode:
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>2011-04-16 02:05:50 -0400
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>2011-04-16 02:05:50 -0400
commit7e9d52981f2936ab847f8763b6235da0e383947c (patch)
tree0044d5af5444de0aab6685157eadf03a0ff70b40 /cpio
parent387f002d45bf2d5020ec8b329da8685d07281bf2 (diff)
downloadlibarchive-7e9d52981f2936ab847f8763b6235da0e383947c.tar.gz
Tweak a test of cpio date format for Windows.
SVN-Revision: 3245
Diffstat (limited to 'cpio')
-rw-r--r--cpio/test/test_option_t.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpio/test/test_option_t.c b/cpio/test/test_option_t.c
index 2d6636be..6bcaee3c 100644
--- a/cpio/test/test_option_t.c
+++ b/cpio/test/test_option_t.c
@@ -35,6 +35,7 @@ DEFINE_TEST(test_option_t)
int r;
time_t mtime;
char date[32];
+ char date2[32];
/* List reference archive, make sure the TOC is correct. */
extract_reference_file("test_option_t.cpio");
@@ -87,12 +88,13 @@ DEFINE_TEST(test_option_t)
setlocale(LC_ALL, "");
#endif
#if defined(_WIN32) && !defined(__CYGWIN__)
- strftime(date, sizeof(date), "%b %d %Y ", localtime(&mtime));
+ strftime(date2, sizeof(date), "%b %d %Y", localtime(&mtime));
+ _snprintf(date, sizeof(date)-1, "%12s file", date2);
#else
- strftime(date, sizeof(date), "%b %e %Y ", localtime(&mtime));
+ strftime(date2, sizeof(date), "%b %e %Y", localtime(&mtime));
+ snprintf(date, sizeof(date)-1, "%12s file", date2);
#endif
assertEqualMem(p + 42, date, strlen(date));
- assertEqualMem(p + 42 + strlen(date)-1, " file", 5);
free(p);
/* But "-n" without "-t" is an error. */