Skip to content

Commit 81f84a2

Browse files
Actually run the tests for word typing (#61)
* Actually run the tests for word typing * Comment out problematic function
1 parent 0abbfda commit 81f84a2

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

tests/src/kb_cmd.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ static struct KbCmd endCMD() {
171171
typedef void (*KeyPressHandler)(struct PS2Buf_t);
172172
typedef int (*ExecFunc)(struct KbCmd, int *, KeyPressHandler);
173173

174-
static void baseKeyHandler(struct PS2Buf_t kb) {
175-
vgaEditor(kb);
176-
}
174+
// Commented out to avoid gcc complaining about it being unused
175+
// static void baseKeyHandler(struct PS2Buf_t kb) {
176+
// vgaEditor(kb);
177+
// }
177178

178179
static int baseExec(struct KbCmd cmd, int *idx, KeyPressHandler kp) {
179180
switch (cmd.cmd) {

tests/src/test_kb_cmd.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ int shiftTest() {
9494

9595
// Word type testing
9696
int wordTest() {
97-
ASSERT(strncmp("test", buff, 5))
97+
ASSERT(strncmp("test", buff, 5) == 0)
9898
return 0;
9999
}
100100

101101
int complexWordTest() {
102-
ASSERT(strncmp("This is a very Loong word$%@^@\\", buff, 32))
102+
ASSERT(strncmp("This is a very Loong word$%@^@\\", buff, 32) == 0)
103103
return 0;
104104
}
105105

@@ -133,10 +133,14 @@ void test_main() {
133133
// Word type test
134134
funcCMD(wordTestStart),
135135
typeWordCMD("test"),
136+
funcCMD(wordTest),
136137
funcCMD(wordTestEnd),
137138

139+
funcCMD(resetBuff),
140+
138141
funcCMD(complexWordTestStart),
139142
typeWordCMD("This is a very Loong word$%@^@\\"),
143+
funcCMD(complexWordTest),
140144
funcCMD(complexWordTestEnd),
141145

142146
endCMD(),

0 commit comments

Comments
 (0)