Skip to content

Commit

Permalink
mark test functions as potentially unused
Browse files Browse the repository at this point in the history
  • Loading branch information
mauke committed Jul 22, 2015
1 parent d18913f commit 92b9482
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions t/test-simple.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ THE SOFTWARE.
#include <stdlib.h>
#include <stdarg.h>

#ifdef __GNUC__
#define ATTR_UNUSED __attribute__((__unused__))
#else
#define ATTR_UNUSED
#endif

static unsigned test_counter;

static void plan(unsigned n) {
Expand All @@ -36,6 +42,7 @@ static void plan(unsigned n) {
printf("1..%u\n", n);
}

ATTR_UNUSED
static void ok(int b, const char *fmt, ...) {
va_list ap;
printf("%sok %u - ", b ? "" : "not ", test_counter++);
Expand All @@ -45,11 +52,13 @@ static void ok(int b, const char *fmt, ...) {
printf("\n");
}

ATTR_UNUSED
static void bail_out(const char *s) {
printf("Bail out! %s\n", s);
exit(EXIT_FAILURE);
}

ATTR_UNUSED
static void diag(const char *s) {
printf("# %s\n", s);
}
Expand Down

0 comments on commit 92b9482

Please sign in to comment.