mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-24 00:27:40 +00:00
chore(developer): add CompMsg GetCompilerErrorString test
This commit is contained in:
parent
35f401780f
commit
bd4aeffcb7
2 changed files with 30 additions and 0 deletions
19
developer/src/kmcmplib/tests/gtest-compmsg-test.cpp
Normal file
19
developer/src/kmcmplib/tests/gtest-compmsg-test.cpp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include "..\..\..\..\common\include\km_types.h"
|
||||
#include "..\..\..\..\common\include\kmn_compiler_errors.h"
|
||||
|
||||
KMX_CHAR *GetCompilerErrorString(KMX_DWORD code);
|
||||
|
||||
class CompMsgTest : public testing::Test {
|
||||
protected:
|
||||
CompMsgTest() {}
|
||||
~CompMsgTest() override {}
|
||||
void SetUp() override {}
|
||||
void TearDown() override {}
|
||||
};
|
||||
|
||||
TEST_F(CompMsgTest, GetCompilerErrorString) {
|
||||
EXPECT_EQ(nullptr, GetCompilerErrorString(CERR_None));
|
||||
EXPECT_EQ(nullptr, GetCompilerErrorString(0x00004FFF)); // top of range ERROR
|
||||
EXPECT_EQ("Invalid 'layout' command", GetCompilerErrorString(CERR_InvalidLayoutLine));
|
||||
};
|
||||
|
|
@ -165,3 +165,14 @@ gtestcompilertest = executable('gtest-compiler-test', 'gtest-compiler-test.cpp',
|
|||
)
|
||||
|
||||
test('gtest-compiler-test', gtestcompilertest)
|
||||
|
||||
gtestcompmsgtest = executable('gtest-compmsg-test', 'gtest-compmsg-test.cpp',
|
||||
cpp_args: defns + flags,
|
||||
include_directories: inc,
|
||||
name_suffix: name_suffix,
|
||||
link_args: links + tests_links,
|
||||
objects: lib.extract_all_objects(),
|
||||
dependencies: [ icuuc_dep, gtest_dep, gmock_dep ],
|
||||
)
|
||||
|
||||
test('gtest-compmsg-test', gtestcompmsgtest)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue