chore(developer): add CompMsg GetCompilerErrorString test

This commit is contained in:
Dr Mark C. Sinclair 2024-05-13 12:20:32 +01:00
parent 35f401780f
commit bd4aeffcb7
2 changed files with 30 additions and 0 deletions

View 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));
};

View file

@ -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)