From 50dfb4359619563012997bc3ddafb7667741066c Mon Sep 17 00:00:00 2001 From: Mamadou DIOP Date: Tue, 23 Feb 2016 22:00:35 +0100 Subject: Add new QoS implementation Code formatting --- tinySAK/test/test_timer.h | 110 +++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 56 deletions(-) (limited to 'tinySAK/test/test_timer.h') diff --git a/tinySAK/test/test_timer.h b/tinySAK/test/test_timer.h index 2b7ab4f..8f28b0c 100755 --- a/tinySAK/test/test_timer.h +++ b/tinySAK/test/test_timer.h @@ -2,103 +2,101 @@ * Copyright (C) 2009 Mamadou Diop. * * Contact: Mamadou Diop -* +* * This file is part of Open Source Doubango Framework. * * DOUBANGO is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. -* +* * DOUBANGO is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. -* +* * You should have received a copy of the GNU General Public License * along with DOUBANGO. * */ #ifndef _TEST_TIMER_H_ #define _TEST_TIMER_H_ -typedef struct test_timer_s -{ - tsk_timer_id_t id; - uint64_t timeout; - const char *arg; +typedef struct test_timer_s { + tsk_timer_id_t id; + uint64_t timeout; + const char *arg; } test_timer_t; -test_timer_t timers[] = -{ - {0, 2000, "3"}, - {1, 2500, "4"}, - {2, 500, "1"}, - {3, 1000, "2"}, - {4, 1000, "2"}, - {5, 0, "0"}, - {6, 10000, "6"}, - {7, 3000, "5"}, - {8, 2500, "4"}, +test_timer_t timers[] = { + {0, 2000, "3"}, + {1, 2500, "4"}, + {2, 500, "1"}, + {3, 1000, "2"}, + {4, 1000, "2"}, + {5, 0, "0"}, + {6, 10000, "6"}, + {7, 3000, "5"}, + {8, 2500, "4"}, }; static int test_timer_callback(const void* arg, tsk_timer_id_t timer_id) { - // Do quick job - printf("test_timer - id=%llu and arg=%s//\n", timer_id, arg); - return 0; + // Do quick job + printf("test_timer - id=%llu and arg=%s//\n", timer_id, arg); + return 0; } void test_global_timer() { - size_t i; - tsk_timer_mgr_global_ref(); + size_t i; + tsk_timer_mgr_global_ref(); - // for test: start it two times - tsk_timer_mgr_global_start(); - tsk_timer_mgr_global_start(); + // for test: start it two times + tsk_timer_mgr_global_start(); + tsk_timer_mgr_global_start(); - for(i=0; i