test/printf.c: Format with clang-format
BRANCH=none
TEST=none
static const char err_str[] = "ERROR";
static char output[1024];
-int run(int expect_ret, const char *expect,
- bool output_null, size_t size_limit,
+int run(int expect_ret, const char *expect, bool output_null, size_t size_limit,
const char *format, va_list args)
{
size_t expect_size = expect ? strlen(expect) + 1 : 0;
@@ -34,10 +33,8 @@ int run(int expect_ret, const char *expect,
TEST_ASSERT(expect_size <= size_limit);
memset(output, INIT_VALUE, sizeof(output));
- rv = vsnprintf(output_null ? NULL : output, size_limit,
- format, args);
- ccprintf("received='%.*s' | ret =%d\n",
- 30, output, rv);
+ rv = vsnprintf(output_null ? NULL : output, size_limit, format, args);
+ ccprintf("received='%.*s' | ret =%d\n", 30, output, rv);
TEST_ASSERT_ARRAY_EQ(output, expect, expect_size);
TEST_ASSERT_MEMSET(&output[expect_size], INIT_VALUE,
@@ -59,25 +56,20 @@ int expect_success(const char *expect, const char *format, ...)
int rv;
va_start(args, format);
- rv = run(EC_SUCCESS, expect,
- false, sizeof(output),
- format, args);
+ rv = run(EC_SUCCESS, expect, false, sizeof(output), format, args);
va_end(args);
return rv;
}
-int expect(int expect_ret, const char *expect,
- bool output_null, size_t size_limit,
- const char *format, ...)
+int expect(int expect_ret, const char *expect, bool output_null,
+ size_t size_limit, const char *format, ...)
{
va_list args;
int rv;
va_start(args, format);
- rv = run(expect_ret, expect,
- output_null, size_limit,
- format, args);
+ rv = run(expect_ret, expect, output_null, size_limit, format, args);
va_end(args);
return rv;
@@ -204,14 +196,11 @@ test_static int test_vsnprintf_pointers(void)
T(expect_success("55005e00", "%pP", ptr));
T(expect_success(err_str, "%P", ptr));
/* %p by itself is invalid */
- T(expect(EC_ERROR_INVAL, NO_BYTES_TOUCHED,
- false, 0, "%p"));
+ T(expect(EC_ERROR_INVAL, NO_BYTES_TOUCHED, false, 0, "%p"));
/* %p with an unknown suffix is invalid */
- T(expect(EC_ERROR_INVAL, NO_BYTES_TOUCHED,
- false, 0, "%p "));
+ T(expect(EC_ERROR_INVAL, NO_BYTES_TOUCHED, false, 0, "%p "));
/* %p with an unknown suffix is invalid */
- T(expect(EC_ERROR_INVAL, NO_BYTES_TOUCHED,
- false, 0, "%pQ"));
+ T(expect(EC_ERROR_INVAL, NO_BYTES_TOUCHED, false, 0, "%pQ"));
/* Test %pb, binary format */
T(expect_success("0", "%pb", BINARY_VALUE(val, 0)));
