@ -0,0 +1,8 @@
#ifndef GLOBAL_H
#define GLOBAL_H
typedef enum {
N, E, S, W
} Dir;
#endif
@ -0,0 +1,14 @@
#include "labyrinth.h"
#include "global.h"
#include "stdio.h"
#include "stdlib.h"
void change_direction(Dir *direction){
switch (*direction) {
case N:
*direction = E;
break;
}
#ifndef TEST_H
#define TEST_H
void change_direction(Dir *direction);
#endif // TEST_H
@ -1,6 +0,0 @@
#include "test.h"
int return_5(){
return 5;
int return_5();
@ -0,0 +1,27 @@
#include "unity.h"
void setUp(void)
{
void tearDown(void)
void test_change_direction_from_N_expected_E(void)
/* arrange */
Dir actual = N;
Dir expected = E;
/* act */
change_direction(&actual);
/* assert */
TEST_ASSERT_TRUE(expected == actual);
@ -1,28 +0,0 @@
#ifdef TEST
void test_test__return_5(void)
int expected = 5;
int actual;
actual = return_5();
TEST_ASSERT_EQUAL_INT(expected, actual);
#endif // TEST