Skip to content

Commit

Permalink
chore(developer): add eight test cases for commands without expected …
Browse files Browse the repository at this point in the history
…delimiters
  • Loading branch information
markcsinclair committed Oct 3, 2024
1 parent 947932f commit 54b5781
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions developer/src/kmcmplib/tests/gtest-compiler-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,10 @@ TEST_F(CompilerTest, GetXStringImpl_type_xd_test) {
u16cpy(str, u"dk(%)");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidDeadkey, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));

// dk, KmnCompilerMessages::ERROR_InvalidDeadkey, no delimiters => NULL
u16cpy(str, u"dk");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidDeadkey, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));

// dk, KmnCompilerMessages::ERROR_InvalidDeadkey, no close delimiter => NULL
u16cpy(str, u"dk(");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidDeadkey, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));
Expand Down Expand Up @@ -811,6 +815,10 @@ TEST_F(CompilerTest, GetXStringImpl_type_a_test) {

// KmnCompilerMessages::ERROR_AnyInVirtualKeySection *** TODO ***

// KmnCompilerMessages::ERROR_InvalidAny, no delimiters => NULL
u16cpy(str, u"any");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidAny, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));

// KmnCompilerMessages::ERROR_InvalidAny, no close delimiter => NULL
u16cpy(str, u"any(");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidAny, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));
Expand Down Expand Up @@ -889,6 +897,11 @@ TEST_F(CompilerTest, GetXStringImpl_type_b_test) {

// baselayout, KmnCompilerMessages::ERROR_InvalidInVirtualKeySection *** TODO ***

// baselayout, no delimiters => NULL
fileKeyboard.version = VERSION_90;
u16cpy(str, u"baselayout");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidToken, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));

// baselayout, no close delimiter => NULL
fileKeyboard.version = VERSION_90;
u16cpy(str, u"baselayout(");
Expand Down Expand Up @@ -957,6 +970,11 @@ TEST_F(CompilerTest, GetXStringImpl_type_i_test) {

// if, KmnCompilerMessages::ERROR_InvalidInVirtualKeySection *** TODO ***

// if, no delimiters => NULL
fileKeyboard.version = VERSION_80;
u16cpy(str, u"if");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidIf, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));

// if, no close delimiter => NULL
fileKeyboard.version = VERSION_80;
u16cpy(str, u"if(");
Expand Down Expand Up @@ -1049,6 +1067,10 @@ TEST_F(CompilerTest, GetXStringImpl_type_i_test) {

// index, KmnCompilerMessages::ERROR_InvalidInVirtualKeySection *** TODO ***

// index, no delimiters => NULL
u16cpy(str, u"index");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidIndex, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));

// index, no close delimiter => NULL
u16cpy(str, u"index(");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidIndex, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));
Expand Down Expand Up @@ -1158,6 +1180,10 @@ TEST_F(CompilerTest, GetXStringImpl_type_o_test) {

// outs, KmnCompilerMessages::ERROR_OutsInVirtualKeySection *** TODO ***

// outs, no delimiters => NULL
u16cpy(str, u"outs");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidOuts, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));

// outs, no close delimiter => NULL
u16cpy(str, u"outs(");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidOuts, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));
Expand Down Expand Up @@ -1316,6 +1342,11 @@ TEST_F(CompilerTest, GetXStringImpl_type_c_test) {

// call, KmnCompilerMessages::ERROR_CallInVirtualKeySection *** TODO ***

// call, no delimiters => NULL
fileKeyboard.version = VERSION_501;
u16cpy(str, u"call");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidCall, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));

// call, no close delimiter => NULL
fileKeyboard.version = VERSION_501;
u16cpy(str, u"call(");
Expand Down Expand Up @@ -1402,6 +1433,11 @@ TEST_F(CompilerTest, GetXStringImpl_type_n_test) {

// notany, KmnCompilerMessages::ERROR_AnyInVirtualKeySection *** TODO ***

// notany, no delimiters => NULL
fileKeyboard.version = VERSION_70;
u16cpy(str, u"notany");
EXPECT_EQ(KmnCompilerMessages::ERROR_InvalidAny, GetXStringImpl(tstr, &fileKeyboard, str, u"", output, 80, 0, &newp, FALSE));

// notany, no close delimiter => NULL
fileKeyboard.version = VERSION_70;
u16cpy(str, u"notany(");
Expand Down

0 comments on commit 54b5781

Please sign in to comment.