]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
unittest: Pass errmsg to CHECKM when available
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 31 Jan 2018 21:15:45 +0000 (22:15 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 31 Jan 2018 21:16:43 +0000 (22:16 +0100)
From PR #169.

unittest/test_conf.c

index ea43e2efe153182285d49c56ff0158ef3d199247..96e73473200a208afdcb231046b8c32be63468c9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2016 Joel Rosdahl
+// Copyright (C) 2011-2018 Joel Rosdahl
 //
 // This program is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by the Free
@@ -342,7 +342,8 @@ TEST(conf_set_new_value)
        char *data;
 
        create_file("ccache.conf", "path = vanilla\n");
-       CHECK(conf_set_value_in_file("ccache.conf", "stats", "chocolate", &errmsg));
+       CHECKM(conf_set_value_in_file("ccache.conf", "stats", "chocolate", &errmsg),
+              errmsg);
        data = read_text_file("ccache.conf", 0);
        CHECK(data);
        CHECK_STR_EQ_FREE2("path = vanilla\nstats = chocolate\n", data);
@@ -354,7 +355,8 @@ TEST(conf_set_existing_value)
        char *data;
 
        create_file("ccache.conf", "path = chocolate\nstats = chocolate\n");
-       CHECK(conf_set_value_in_file("ccache.conf", "path", "vanilla", &errmsg));
+       CHECKM(conf_set_value_in_file("ccache.conf", "path", "vanilla", &errmsg),
+              errmsg);
        data = read_text_file("ccache.conf", 0);
        CHECK(data);
        CHECK_STR_EQ_FREE2("path = vanilla\nstats = chocolate\n", data);