重新进行了概要设计

This commit is contained in:
2022-05-17 20:22:29 +08:00
parent 016db27c0c
commit 7a35acda0c
9 changed files with 399 additions and 165 deletions

View File

@@ -9,6 +9,9 @@ extern "C"
{
#endif
#include "rail.h"
#include "bus_io.h"
#include "query.h"
#include "define.h"
#ifdef __cplusplus
}
#endif
@@ -24,3 +27,30 @@ TEST(test, test)
int result = add(1, 1);
EXPECT_EQ(2, result);
}
/**
* 测试输入读取函数读取clock时的行为
*/
TEST(io_test, io_clock)
{
char input[7] = "clock\n";
int result = ReadInput(input);
EXPECT_EQ(result, IO_CLOCK);
}
/**
* 测试顺时针3号站台上车请求
*/
TEST(io_test, reading)
{
char input[] = "counterclockwise 3\n";
int result = ReadInput(input);
EXPECT_EQ(result, IO_READING);
}
TEST(io_test, end)
{
char input[] = "end\n";
int result = ReadInput(input);
EXPECT_EQ(result, IO_END);
}