mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-23 20:35:46 +03:00
Update brace style.
Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
This commit is contained in:
parent
5154ff32ee
commit
c4c2592c83
119 changed files with 2971 additions and 3572 deletions
|
|
@ -7,8 +7,7 @@ static const char * test_name = "";
|
|||
|
||||
JEMALLOC_FORMAT_PRINTF(1, 2)
|
||||
void
|
||||
test_skip(const char *format, ...)
|
||||
{
|
||||
test_skip(const char *format, ...) {
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, format);
|
||||
|
|
@ -20,8 +19,7 @@ test_skip(const char *format, ...)
|
|||
|
||||
JEMALLOC_FORMAT_PRINTF(1, 2)
|
||||
void
|
||||
test_fail(const char *format, ...)
|
||||
{
|
||||
test_fail(const char *format, ...) {
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, format);
|
||||
|
|
@ -32,8 +30,7 @@ test_fail(const char *format, ...)
|
|||
}
|
||||
|
||||
static const char *
|
||||
test_status_string(test_status_t test_status)
|
||||
{
|
||||
test_status_string(test_status_t test_status) {
|
||||
switch (test_status) {
|
||||
case test_status_pass: return "pass";
|
||||
case test_status_skip: return "skip";
|
||||
|
|
@ -43,23 +40,20 @@ test_status_string(test_status_t test_status)
|
|||
}
|
||||
|
||||
void
|
||||
p_test_init(const char *name)
|
||||
{
|
||||
p_test_init(const char *name) {
|
||||
test_count++;
|
||||
test_status = test_status_pass;
|
||||
test_name = name;
|
||||
}
|
||||
|
||||
void
|
||||
p_test_fini(void)
|
||||
{
|
||||
p_test_fini(void) {
|
||||
test_counts[test_status]++;
|
||||
malloc_printf("%s: %s\n", test_name, test_status_string(test_status));
|
||||
}
|
||||
|
||||
static test_status_t
|
||||
p_test_impl(bool do_malloc_init, test_t *t, va_list ap)
|
||||
{
|
||||
p_test_impl(bool do_malloc_init, test_t *t, va_list ap) {
|
||||
test_status_t ret;
|
||||
|
||||
if (do_malloc_init) {
|
||||
|
|
@ -78,8 +72,9 @@ p_test_impl(bool do_malloc_init, test_t *t, va_list ap)
|
|||
ret = test_status_pass;
|
||||
for (; t != NULL; t = va_arg(ap, test_t *)) {
|
||||
t();
|
||||
if (test_status > ret)
|
||||
if (test_status > ret) {
|
||||
ret = test_status;
|
||||
}
|
||||
}
|
||||
|
||||
malloc_printf("--- %s: %u/%u, %s: %u/%u, %s: %u/%u ---\n",
|
||||
|
|
@ -94,8 +89,7 @@ p_test_impl(bool do_malloc_init, test_t *t, va_list ap)
|
|||
}
|
||||
|
||||
test_status_t
|
||||
p_test(test_t *t, ...)
|
||||
{
|
||||
p_test(test_t *t, ...) {
|
||||
test_status_t ret;
|
||||
va_list ap;
|
||||
|
||||
|
|
@ -108,8 +102,7 @@ p_test(test_t *t, ...)
|
|||
}
|
||||
|
||||
test_status_t
|
||||
p_test_no_malloc_init(test_t *t, ...)
|
||||
{
|
||||
p_test_no_malloc_init(test_t *t, ...) {
|
||||
test_status_t ret;
|
||||
va_list ap;
|
||||
|
||||
|
|
@ -122,8 +115,7 @@ p_test_no_malloc_init(test_t *t, ...)
|
|||
}
|
||||
|
||||
void
|
||||
p_test_fail(const char *prefix, const char *message)
|
||||
{
|
||||
p_test_fail(const char *prefix, const char *message) {
|
||||
malloc_cprintf(NULL, NULL, "%s%s\n", prefix, message);
|
||||
test_status = test_status_fail;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue