mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-31 04:37:41 +00:00
chore(developer): add initFileKeyboard() method
This commit is contained in:
parent
c1d5d45b8f
commit
cdb71f4329
1 changed files with 11 additions and 11 deletions
|
|
@ -43,8 +43,7 @@ class CompilerTest : public testing::Test {
|
|||
initFileKeyboard(fileKeyboard);
|
||||
}
|
||||
void TearDown() override {
|
||||
initGlobals();
|
||||
initFileKeyboard(fileKeyboard, false);
|
||||
deleteFileKeyboard(fileKeyboard);
|
||||
}
|
||||
|
||||
void initGlobals() {
|
||||
|
|
@ -59,15 +58,7 @@ class CompilerTest : public testing::Test {
|
|||
kmcmp::BeginLine[BEGIN_POSTKEYSTROKE] = -1;
|
||||
}
|
||||
|
||||
void initFileKeyboard(FILE_KEYBOARD &fk, bool isSetUp=true) {
|
||||
if (!isSetUp) {
|
||||
if (fk.dpStoreArray) { delete[] fk.dpStoreArray; }
|
||||
if (fk.dpGroupArray) { delete[] fk.dpGroupArray; }
|
||||
if (fk.lpBitmap) { delete fk.lpBitmap; }
|
||||
if (fk.dpDeadKeyArray) { delete[] fk.dpDeadKeyArray; }
|
||||
if (fk.dpVKDictionary) { delete fk.dpVKDictionary; }
|
||||
if (fk.extra) { delete fk.extra; }
|
||||
}
|
||||
void initFileKeyboard(FILE_KEYBOARD &fk) {
|
||||
fk.KeyboardID = 0;
|
||||
fk.version = VERSION_90;
|
||||
fk.dpStoreArray = nullptr;
|
||||
|
|
@ -93,6 +84,15 @@ class CompilerTest : public testing::Test {
|
|||
fk.extra = nullptr;
|
||||
}
|
||||
|
||||
void deleteFileKeyboard(FILE_KEYBOARD &fk) {
|
||||
if (fk.dpStoreArray) { delete[] fk.dpStoreArray; }
|
||||
if (fk.dpGroupArray) { delete[] fk.dpGroupArray; }
|
||||
if (fk.lpBitmap) { delete fk.lpBitmap; }
|
||||
if (fk.dpDeadKeyArray) { delete[] fk.dpDeadKeyArray; }
|
||||
if (fk.dpVKDictionary) { delete fk.dpVKDictionary; }
|
||||
if (fk.extra) { delete fk.extra; }
|
||||
}
|
||||
|
||||
public:
|
||||
static KMX_CHAR szText_stub[];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue