SoW-2019-0002: Dynamic Snapshot
[lttng-tools.git] / tests / regression / tools / rotation / schedule_api.c
index 0ab367152f066c08cf827c3df8e62b8526724d6c..1e19f5be34580f53bbc6e17ec875f05ceb6bcfb2 100644 (file)
@@ -5,23 +5,8 @@
  *
  * Copyright (C) 2018 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
- * 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 <stddef.h>
@@ -37,7 +22,7 @@
 
 const char *session_name;
 
-bool schedules_equal(const struct lttng_rotation_schedule *a,
+static bool schedules_equal(const struct lttng_rotation_schedule *a,
                const struct lttng_rotation_schedule *b)
 {
        bool equal = false;
@@ -99,7 +84,7 @@ end:
        return equal;
 }
 
-void test_add_null_session(void)
+static void test_add_null_session(void)
 {
        enum lttng_rotation_status status;
        struct lttng_rotation_schedule *size_schedule = NULL;
@@ -109,9 +94,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);
 }
 
-void test_add_null_schedule(void)
+static void test_add_null_schedule(void)
 {
        enum lttng_rotation_status status;
 
@@ -120,7 +106,7 @@ void test_add_null_schedule(void)
                        "NULL schedule rejected by lttng_session_add_rotation_schedule()");
 }
 
-void test_add_uninitialized_schedule(void)
+static void test_add_uninitialized_schedule(void)
 {
        enum lttng_rotation_status status;
        struct lttng_rotation_schedule *size_schedule = NULL,
@@ -146,7 +132,7 @@ void test_add_uninitialized_schedule(void)
        lttng_rotation_schedule_destroy(periodic_schedule);
 }
 
-void test_remove_null_session(void)
+static void test_remove_null_session(void)
 {
        enum lttng_rotation_status status;
        struct lttng_rotation_schedule *size_schedule = NULL;
@@ -156,9 +142,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);
 }
 
-void test_remove_null_schedule(void)
+static void test_remove_null_schedule(void)
 {
        enum lttng_rotation_status status;
 
@@ -167,7 +154,7 @@ void test_remove_null_schedule(void)
                        "NULL schedule rejected by lttng_session_remove_rotation_schedule()");
 }
 
-void test_remove_uninitialized_schedule(void)
+static void test_remove_uninitialized_schedule(void)
 {
        enum lttng_rotation_status status;
        struct lttng_rotation_schedule *size_schedule = NULL,
@@ -189,7 +176,7 @@ void test_remove_uninitialized_schedule(void)
        lttng_rotation_schedule_destroy(periodic_schedule);
 }
 
-void test_uninitialized_schedule_get(void)
+static void test_uninitialized_schedule_get(void)
 {
        uint64_t value;
        enum lttng_rotation_status status;
@@ -213,7 +200,7 @@ void test_uninitialized_schedule_get(void)
 
 }
 
-void test_add_list_remove_schedule(
+static void test_add_list_remove_schedule(
                const struct lttng_rotation_schedule *original_schedule)
 {
        int ret;
@@ -262,7 +249,7 @@ void test_add_list_remove_schedule(
 
 }
 
-void test_add_list_remove_size_schedule(void)
+static void test_add_list_remove_size_schedule(void)
 {
        struct lttng_rotation_schedule *size_schedule;
 
@@ -274,7 +261,7 @@ void test_add_list_remove_size_schedule(void)
        lttng_rotation_schedule_destroy(size_schedule);
 }
 
-void test_add_list_remove_periodic_schedule(void)
+static void test_add_list_remove_periodic_schedule(void)
 {
        struct lttng_rotation_schedule *periodic_schedule;
 
This page took 0.0252 seconds and 5 git commands to generate.