From 4dff49735e96340a52a2cee536fd998166bb7326 Mon Sep 17 00:00:00 2001 From: Joe Lukas Kalb Date: Tue, 6 Feb 2024 18:12:44 +0100 Subject: [PATCH] refactoring: change_direction --- src/main/c/global.h | 2 +- src/main/c/labyrinth.c | 2 +- src/main/c/labyrinth.h | 2 +- src/test/c/test_labyrinth.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/c/global.h b/src/main/c/global.h index b6aa8f0..556a1f1 100644 --- a/src/main/c/global.h +++ b/src/main/c/global.h @@ -3,6 +3,6 @@ typedef enum { N, E, S, W -} Dir; +} Direction; #endif \ No newline at end of file diff --git a/src/main/c/labyrinth.c b/src/main/c/labyrinth.c index 8067030..980b367 100644 --- a/src/main/c/labyrinth.c +++ b/src/main/c/labyrinth.c @@ -5,7 +5,7 @@ #include "stdio.h" #include "stdlib.h" -void change_direction(Dir *direction){ +void turn_direction_right(Direction *direction){ switch (*direction) { case N: *direction = E; diff --git a/src/main/c/labyrinth.h b/src/main/c/labyrinth.h index 0ab2124..4c077e9 100644 --- a/src/main/c/labyrinth.h +++ b/src/main/c/labyrinth.h @@ -3,6 +3,6 @@ #include "global.h" -void change_direction(Dir *direction); +void turn_direction_right(Direction *direction); #endif // TEST_H diff --git a/src/test/c/test_labyrinth.c b/src/test/c/test_labyrinth.c index 9426c2c..a31da00 100644 --- a/src/test/c/test_labyrinth.c +++ b/src/test/c/test_labyrinth.c @@ -15,11 +15,11 @@ void tearDown(void) void test_change_direction_from_N_expected_E(void) { /* arrange */ - Dir actual = N; - Dir expected = E; + Direction actual = N; + Direction expected = E; /* act */ - change_direction(&actual); + turn_direction_right(&actual); /* assert */ TEST_ASSERT_TRUE(expected == actual);