From 7994f14ae5ddc993d277a49d67d60a987f75d8ba Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 4 Jan 2016 23:58:19 +0000 Subject: [PATCH] tests/utime.c: use libtests * tests/utime.c (main): Use assert and perror_msg_and_skip. --- tests/utime.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/utime.c b/tests/utime.c index 89c5b8ab..fa1003de 100644 --- a/tests/utime.c +++ b/tests/utime.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2016 Dmitry V. Levin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,6 +25,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "tests.h" +#include #include #include #include @@ -49,8 +51,11 @@ main(void) print_tm(p); printf(", "); print_tm(p); - puts("]) = -1 ENOENT (No such file or directory)"); + printf("]) = -1 ENOENT "); + assert(utime("utime\nfilename", &u) == -1); + if (ENOENT != errno) + perror_msg_and_skip("utime"); + printf("(%m)\n"); puts("+++ exited with 0 +++"); - - return utime("utime\nfilename", &u) == -1 && errno == ENOENT ? 0 : 77; + return 0; } -- 2.40.0