summaryrefslogtreecommitdiffstats
path: root/test/unit/mq.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2017-01-16 00:56:30 (GMT)
committerJason Evans <jasone@canonware.com>2017-01-21 05:43:07 (GMT)
commitc4c2592c834d8a37beb0a0d53842095160cbf9ee (patch)
treee4717ea6a2f13926dadd74ea1fc83f9742f77968 /test/unit/mq.c
parent5154ff32ee8c37bacb6afd8a07b923eb33228357 (diff)
downloadjemalloc-c4c2592c834d8a37beb0a0d53842095160cbf9ee.zip
jemalloc-c4c2592c834d8a37beb0a0d53842095160cbf9ee.tar.gz
jemalloc-c4c2592c834d8a37beb0a0d53842095160cbf9ee.tar.bz2
Update brace style.
Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
Diffstat (limited to 'test/unit/mq.c')
-rw-r--r--test/unit/mq.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/test/unit/mq.c b/test/unit/mq.c
index bd289c5..95c9c50 100644
--- a/test/unit/mq.c
+++ b/test/unit/mq.c
@@ -9,8 +9,7 @@ struct mq_msg_s {
};
mq_gen(static, mq_, mq_t, mq_msg_t, link)
-TEST_BEGIN(test_mq_basic)
-{
+TEST_BEGIN(test_mq_basic) {
mq_t mq;
mq_msg_t msg;
@@ -31,8 +30,7 @@ TEST_BEGIN(test_mq_basic)
TEST_END
static void *
-thd_receiver_start(void *arg)
-{
+thd_receiver_start(void *arg) {
mq_t *mq = (mq_t *)arg;
unsigned i;
@@ -45,8 +43,7 @@ thd_receiver_start(void *arg)
}
static void *
-thd_sender_start(void *arg)
-{
+thd_sender_start(void *arg) {
mq_t *mq = (mq_t *)arg;
unsigned i;
@@ -61,8 +58,7 @@ thd_sender_start(void *arg)
return (NULL);
}
-TEST_BEGIN(test_mq_threaded)
-{
+TEST_BEGIN(test_mq_threaded) {
mq_t mq;
thd_t receiver;
thd_t senders[NSENDERS];
@@ -71,20 +67,21 @@ TEST_BEGIN(test_mq_threaded)
assert_false(mq_init(&mq), "Unexpected mq_init() failure");
thd_create(&receiver, thd_receiver_start, (void *)&mq);
- for (i = 0; i < NSENDERS; i++)
+ for (i = 0; i < NSENDERS; i++) {
thd_create(&senders[i], thd_sender_start, (void *)&mq);
+ }
thd_join(receiver, NULL);
- for (i = 0; i < NSENDERS; i++)
+ for (i = 0; i < NSENDERS; i++) {
thd_join(senders[i], NULL);
+ }
mq_fini(&mq);
}
TEST_END
int
-main(void)
-{
+main(void) {
return (test(
test_mq_basic,
test_mq_threaded));