Skip to content

Commit

Permalink
Fixes for modern uncrustify. (#793)
Browse files Browse the repository at this point in the history
Mostly just redoing macros to make them fit on one
line so we can avoid problems between old and new uncrustify.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored Mar 26, 2024
1 parent ad59de0 commit bbddf46
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions rosidl_generator_tests/test/rosidl_generator_c/test_interfaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,16 @@
u"Deep into that darkness peering, long I stood there wondering, fearing \u2122"
#define ARR_SIZE 3

#define STRINGIFY(x) _STRINGIFY(x)
#define _STRINGIFY(x) #x
#define STRINGIFY(x) _STRINGIFY(x)

#define EXPECT_FALSE(arg) if (arg) { \
fputs(STRINGIFY(arg) " is not false\n", stderr); \
return 1; \
}
#define EXPECT_TRUE(arg) if (!(arg)) { \
fputs(STRINGIFY(arg) " is not true\n", stderr); \
return 1; \
}
#define EXPECT_EQ(arg1, arg2) if ((arg1) != (arg2)) { \
fputs(STRINGIFY(arg1) " != " STRINGIFY(arg2) "\n", stderr); \
return 1; \
}
#define PUTS(arg, extra) fprintf(stderr, "%s%s\n", STRINGIFY(arg), extra)

#define EXPECT_FALSE(arg) if (arg) {PUTS(arg, " is not false"); return 1;}
#define EXPECT_TRUE(arg) if (!(arg)) {PUTS(arg, " is not true"); return 1;}

#define PUTS_NE(arg1, arg2) fprintf(stderr, "%s != %s\n", STRINGIFY(arg1), STRINGIFY(arg2))
#define EXPECT_EQ(arg1, arg2) if ((arg1) != (arg2)) {PUTS_NE(arg1, arg2); return 1;}
#define EXPECT_NE(arg1, arg2) if ((arg1) == (arg2)) return 1

static const uint8_t test_values_byte[ARR_SIZE] = {0, 57, 110};
Expand Down

0 comments on commit bbddf46

Please sign in to comment.