X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Frotation%2Fschedule_api.c;h=61146856379f500d2b3dde2f96897655b21cf0b6;hb=f12eb9c1ceb619db54be0842323a32cda12651cd;hp=0ab367152f066c08cf827c3df8e62b8526724d6c;hpb=ed9f1fb24a21b222c23684cdf8e77b4d21c21895;p=deliverable%2Flttng-tools.git diff --git a/tests/regression/tools/rotation/schedule_api.c b/tests/regression/tools/rotation/schedule_api.c index 0ab367152..611468563 100644 --- a/tests/regression/tools/rotation/schedule_api.c +++ b/tests/regression/tools/rotation/schedule_api.c @@ -5,23 +5,8 @@ * * Copyright (C) 2018 Jérémie Galarneau * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * SPDX-License-Identifier: MIT * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #include @@ -37,6 +22,7 @@ const char *session_name; +static bool schedules_equal(const struct lttng_rotation_schedule *a, const struct lttng_rotation_schedule *b) { @@ -99,6 +85,7 @@ end: return equal; } +static void test_add_null_session(void) { enum lttng_rotation_status status; @@ -109,8 +96,10 @@ void test_add_null_session(void) status = lttng_session_add_rotation_schedule(NULL, size_schedule); ok(status == LTTNG_ROTATION_STATUS_INVALID, "NULL session name rejected by lttng_session_add_rotation_schedule()"); + lttng_rotation_schedule_destroy(size_schedule); } +static void test_add_null_schedule(void) { enum lttng_rotation_status status; @@ -120,6 +109,7 @@ void test_add_null_schedule(void) "NULL schedule rejected by lttng_session_add_rotation_schedule()"); } +static void test_add_uninitialized_schedule(void) { enum lttng_rotation_status status; @@ -146,6 +136,7 @@ void test_add_uninitialized_schedule(void) lttng_rotation_schedule_destroy(periodic_schedule); } +static void test_remove_null_session(void) { enum lttng_rotation_status status; @@ -156,8 +147,10 @@ void test_remove_null_session(void) status = lttng_session_remove_rotation_schedule(NULL, size_schedule); ok(status == LTTNG_ROTATION_STATUS_INVALID, "NULL session name rejected by lttng_session_remove_rotation_schedule()"); + lttng_rotation_schedule_destroy(size_schedule); } +static void test_remove_null_schedule(void) { enum lttng_rotation_status status; @@ -167,6 +160,7 @@ void test_remove_null_schedule(void) "NULL schedule rejected by lttng_session_remove_rotation_schedule()"); } +static void test_remove_uninitialized_schedule(void) { enum lttng_rotation_status status; @@ -189,6 +183,7 @@ void test_remove_uninitialized_schedule(void) lttng_rotation_schedule_destroy(periodic_schedule); } +static void test_uninitialized_schedule_get(void) { uint64_t value; @@ -213,6 +208,7 @@ void test_uninitialized_schedule_get(void) } +static void test_add_list_remove_schedule( const struct lttng_rotation_schedule *original_schedule) { @@ -262,6 +258,7 @@ void test_add_list_remove_schedule( } +static void test_add_list_remove_size_schedule(void) { struct lttng_rotation_schedule *size_schedule; @@ -274,6 +271,7 @@ void test_add_list_remove_size_schedule(void) lttng_rotation_schedule_destroy(size_schedule); } +static void test_add_list_remove_periodic_schedule(void) { struct lttng_rotation_schedule *periodic_schedule;