From 1ba21da6cbc63c0c549fb92731e25bedc482eb51 Mon Sep 17 00:00:00 2001 From: Filip Wandzio Date: Thu, 4 Sep 2025 22:25:39 +0200 Subject: Unify the directory, add new analysis methods, unify the code style Signed-off-by: Filip Wandzio --- test/rtt_test.c | 55 ------------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 test/rtt_test.c (limited to 'test/rtt_test.c') diff --git a/test/rtt_test.c b/test/rtt_test.c deleted file mode 100644 index cdedabd..0000000 --- a/test/rtt_test.c +++ /dev/null @@ -1,55 +0,0 @@ -#include -#include - -#define SENT_TIME_1_MS 1000 -#define NOW_TIME_1_MS 1500 -#define RTT_POSITIVE_EXPECTED 500 - -#define SENT_TIME_2_MS 2000 -#define NOW_TIME_2_MS 2000 -#define RTT_ZERO_EXPECTED 0 - -#define SENT_TIME_3_MS 3000 -#define NOW_TIME_3_MS 2500 -#define RTT_NEGATIVE_EXPECTED (-500) - -/* - * calculate_rtt - calculate round-trip time - * @sent_ms: time when message was sent (ms) - * @now_ms: current time (ms) - * - * Return: RTT in milliseconds (now_ms - sent_ms) - */ -static int32_t calculate_rtt(int32_t sent_ms, int32_t now_ms) -{ - return now_ms - sent_ms; -} - -static void test_rtt_positive_difference(void) -{ - TEST_ASSERT_EQUAL_INT32(RTT_POSITIVE_EXPECTED, - calculate_rtt(SENT_TIME_1_MS, NOW_TIME_1_MS)); -} - -static void test_rtt_zero_difference(void) -{ - TEST_ASSERT_EQUAL_INT32(RTT_ZERO_EXPECTED, - calculate_rtt(SENT_TIME_2_MS, NOW_TIME_2_MS)); -} - -static void test_rtt_negative_difference(void) -{ - TEST_ASSERT_EQUAL_INT32(RTT_NEGATIVE_EXPECTED, - calculate_rtt(SENT_TIME_3_MS, NOW_TIME_3_MS)); -} - -int app_main(void) -{ - UNITY_BEGIN(); - - RUN_TEST(test_rtt_positive_difference); - RUN_TEST(test_rtt_zero_difference); - RUN_TEST(test_rtt_negative_difference); - - return UNITY_END(); -} -- cgit v1.2.3