Coding style change
This commit is contained in:
+10
-10
@@ -17,7 +17,7 @@ START_TEST (test_thread_queue_length)
|
||||
int i;
|
||||
|
||||
fail_if(uc_thread_queue_init(&queue, 100) != 0);
|
||||
for(i = 0; i < 51; i++) {
|
||||
for (i = 0; i < 51; i++) {
|
||||
struct thr_msg *msg = malloc(sizeof *msg);
|
||||
fail_if(msg == NULL);
|
||||
msg->msg.msgtype = 1;
|
||||
@@ -34,7 +34,7 @@ START_TEST (test_thread_queue_one_thread)
|
||||
int i;
|
||||
|
||||
fail_if(uc_thread_queue_init(&queue, 100) != 0);
|
||||
for(i = 0; i < 51; i++) {
|
||||
for (i = 0; i < 51; i++) {
|
||||
struct thr_msg *msg = malloc(sizeof *msg);
|
||||
fail_if(msg == NULL);
|
||||
msg->msg.msgtype = 0;
|
||||
@@ -42,7 +42,7 @@ START_TEST (test_thread_queue_one_thread)
|
||||
fail_if(uc_thread_queue_add(&queue, &msg->msg) != 0);
|
||||
}
|
||||
|
||||
for(i = 0; i < 51; i++) {
|
||||
for (i = 0; i < 51; i++) {
|
||||
struct uc_threadmsg *msg;
|
||||
struct thr_msg *my_msg;
|
||||
fail_if(uc_thread_queue_get(&queue, NULL, &msg) != 0);
|
||||
@@ -70,7 +70,7 @@ START_TEST (test_thread_queue_walk)
|
||||
int i;
|
||||
|
||||
fail_if(uc_thread_queue_init(&queue, 100) != 0);
|
||||
for(i = 0; i < 51; i++) {
|
||||
for (i = 0; i < 51; i++) {
|
||||
struct thr_msg *msg = malloc(sizeof *msg);
|
||||
fail_if(msg == NULL);
|
||||
msg->a = i;
|
||||
@@ -91,7 +91,7 @@ static void *test_thread_queue_reader_writer_func(void *arg)
|
||||
struct uc_threadqueue *queue = arg;
|
||||
int i;
|
||||
|
||||
for(i = 0; i < READER_WRITER_NUM_MSG; i++) {
|
||||
for (i = 0; i < READER_WRITER_NUM_MSG; i++) {
|
||||
struct uc_threadmsg *msg;
|
||||
struct thr_msg *my_msg;
|
||||
fail_if(uc_thread_queue_get(queue, NULL, &msg) != 0);
|
||||
@@ -113,7 +113,7 @@ START_TEST (test_thread_queue_reader_writer)
|
||||
fail_if(pthread_create(&tid, NULL, test_thread_queue_reader_writer_func, &queue) != 0);
|
||||
sched_yield();
|
||||
|
||||
for(i = 0; i < READER_WRITER_NUM_MSG; i++) {
|
||||
for (i = 0; i < READER_WRITER_NUM_MSG; i++) {
|
||||
struct thr_msg *msg = malloc(sizeof *msg);
|
||||
fail_if(msg == NULL);
|
||||
msg->a = i;
|
||||
@@ -137,7 +137,7 @@ START_TEST (test_thread_queue_reader_writer_len_1)
|
||||
fail_if(pthread_create(&tid, NULL, test_thread_queue_reader_writer_func, &queue) != 0);
|
||||
sched_yield();
|
||||
|
||||
for(i = 0; i < READER_WRITER_NUM_MSG; i++) {
|
||||
for (i = 0; i < READER_WRITER_NUM_MSG; i++) {
|
||||
struct thr_msg *msg = malloc(sizeof *msg);
|
||||
fail_if(msg == NULL);
|
||||
msg->a = i;
|
||||
@@ -162,7 +162,7 @@ void *test_thread_queue_multiple_writers_func(void *arg)
|
||||
struct uc_threadqueue *queue = arg;
|
||||
int i;
|
||||
|
||||
for(i = 0; i < READER_WRITER_NUM_MSG; i++) {
|
||||
for (i = 0; i < READER_WRITER_NUM_MSG; i++) {
|
||||
struct thr_msg *msg = malloc(sizeof *msg);
|
||||
fail_if(msg == NULL);
|
||||
msg->a = i;
|
||||
@@ -185,13 +185,13 @@ START_TEST (test_thread_queue_multiple_writers)
|
||||
fail_if(pthread_create(&tid2, NULL, test_thread_queue_multiple_writers_func, &queue) != 0);
|
||||
fail_if(pthread_create(&tid3, NULL, test_thread_queue_multiple_writers_func, &queue) != 0);
|
||||
|
||||
for(i = 0; i < READER_WRITER_NUM_MSG * 3; i++) {
|
||||
for (i = 0; i < READER_WRITER_NUM_MSG * 3; i++) {
|
||||
struct uc_threadmsg *msg;
|
||||
struct thr_msg *my_msg;
|
||||
fail_if(uc_thread_queue_get(&queue, NULL, &msg) != 0);
|
||||
my_msg = (struct thr_msg *)msg;
|
||||
|
||||
if(my_msg->a == READER_WRITER_NUM_MSG - 1)
|
||||
if (my_msg->a == READER_WRITER_NUM_MSG - 1)
|
||||
count_max++;
|
||||
|
||||
free(my_msg);
|
||||
|
||||
Reference in New Issue
Block a user