spiegel-keyman/common/test/keyboards/invalid/README.md
SabineSIL 048448a2a4
feat(developer): cross-platform kmx compiler 🚑 (#6980)
* get keymans version



Merge branch 'master' of https://github.com/keymanapp/keyman into refactor/developer/6026-kmcompx-compiler-cross-platform-part-2-NEW_VERSION

# Conflicts:
#	common/core/desktop/src/kmx/kmx_context.h
#	common/core/desktop/src/kmx/kmx_processor.cpp
#	common/windows/cpp/include/keymanversion.h
#	common/windows/cpp/include/kkmnkbd/Compfile.h
#	common/windows/cpp/include/kmtip_guids.h
#	common/windows/cpp/src/kmtip_guids.cpp
#	core/src/kmx/kmx_conversion.cpp
#	core/src/kmx/kmx_conversion.h
#	core/src/kmx/kmx_file.cpp
#	core/src/kmx/kmx_processevent.cpp
#	core/src/kmx/kmx_processor.hpp
#	core/src/kmx/kmx_xstring.cpp
#	developer/js/.gitignore
#	developer/js/package-lock.json
#	developer/js/tests/tsconfig.json
#	developer/src/kmcmpdll/CasedKeys.cpp
#	developer/src/kmcmpdll/CheckFilenameConsistency.cpp
#	developer/src/kmcmpdll/CheckFilenameConsistency.h
#	developer/src/kmcmpdll/CheckForDuplicates.cpp
#	developer/src/kmcmpdll/CheckForDuplicates.h
#	developer/src/kmcmpdll/CheckNCapsConsistency.cpp
#	developer/src/kmcmpdll/CheckNCapsConsistency.h
#	developer/src/kmcmpdll/Compiler.cpp
#	developer/src/kmcmpdll/DeprecationChecks.cpp
#	developer/src/kmcmpdll/NamedCodeConstants.cpp
#	developer/src/kmcmpdll/UnreachableRules.cpp
#	developer/src/kmcmpdll/UnreachableRules.h
#	developer/src/kmcmpdll/compfile.h
#	developer/src/kmcmpdll/kcframe/kcframe.cpp
#	developer/src/kmcmpdll/kcframe/kcframe.vcxproj
#	developer/src/kmcmpdll/kcframe/kcframe.vcxproj.filters
#	developer/src/kmcmpdll/kmcmpdll.vcxproj
#	developer/src/kmcmpdll/kmcmpdll.vcxproj.filters
#	developer/src/kmcmpdll/version.rc
#	developer/src/kmcmpdll/versioning.cpp
#	developer/src/kmlmc/bundle.sh
#	developer/src/kmlmc/tests/test-join-word-breaker.ts
#	developer/src/kmlmc/tests/test-override-script-defaults.ts
#	developer/src/server/tsconfig.json
#	windows/src/developer/kmcmpdll/Makefile
#	windows/src/developer/kmcmpdll/vkeys.h
#	windows/src/engine/keyman32/keymanengine.h
#	windows/src/global/inc/Vkeys.h
#	windows/src/global/inc/rc4.h
#	windows/src/global/vc/rc4.cpp

* changes in meson + include-paths of several files

* chore: remove common/core

* chore: remove unnecessary files

* chore: move headers and refs

* refactor(developer): fixup path to tests

* refactor(developer): fixup path to tests
tidied up +removed unnecessary files
checked contents of files+included a few new functions needed for myVersion
changed datatypes in CheckForDuplicates
tidy up more paths
CheckFileConsistency: not able to fully adapt for use of char16_t on non windows p.
	-> used char16_t + commented out some AddWarning().

* sorted out some #includes
renamed some functions to reduce ambiguity

* fix(developer): solved linker errors

* chore(developer): remove some comments

* chore(developer): introduced KMX_UCHAR

* chore(developer): restored whitespace, comments

* chore(developer): tidied up vkeys.H / .cpp

* chore(developer): remove keyboardprocessor...

* chore(common): refactor shared types into km_types.h

* chore(core): remove duplicate types

* chore(core): move kmx_file.h to common

* chore(developper): removed typedefs of kmcompcx.h

* chore(developer): removed kmcompx/include/kmx_file.h

* chore(developer): chanched include of pch.h

* chore(developer): removed files from kmcompx/include/

* chore(developer): removed commented sections ( ** old **) if files

* chore(developer): removed doubled/overwritten functions

* chore(developer): removed doubled/overwritten functions

* chore(developer): changed #includes ".." -> <..>

* chore(developer): changed #includes ".." -> <..>

* chore(developer): enable tests for keyboards repo for kmcompx

* chore(developer): new functions e.g. string_from_wstring...

* chore(developer): changed printf->u16sprintf

* chore(developer): fopen

* chore(developer): fixed errors on running kmcompxtest

* chore(developer): changef u16fmt

* chore(developer): fixup u16ncat

* chore(developer): added return Msgs for different types of errors while compiling

* chore(developer): tests using RTL run Ok ( changed RTu->RTL)

* chore(developer): replaced u16ncmp with u16nicmp at most places

* chore(developer): changed Version number for tests 16.046 to 15.0265

* chore(developer): mostly whitespace changes

* chore(developer): tidied up code (not finished yet)

* chore(developer): removed #pragma once from wrong places, edited #includes

* chore(developer): removed #pragma once from wrong places, edited #includes

* chore(developer): CheckFileNameConsistency changed to take KMX_WCHART const* (= wchar_t* const); used in compiler.cpp now

* chore(developer): excluded some tests from kmcompxtest (use get_test_source_exclude_some_kmn.bat now)

* chore(developer): Win-functions in FileNameConsistency

* chore(developer): Win-functions in FileNameConsistency

* chore(developer): CheckFNConsuistency: called u16printf with f´different par.

* chore(developer): tidied up code

* chore(developer): tidied up code

* chore(developer): tiedied up code (compiler.cpp)

* chore(developer): tiedied up code

* chore(developer): tidied up code

* chore(developer): removed all commentaries _S2

* chore(developer): tidied up code

* chore(developer): tidied up code

* chore(developer): tidied up code

* chore(developer): removed several Windows-specific functions

* chore(developer): removed unused datatype typedefs

* chore(developer): new GetCompilerErrorString() used in AddCompileMessage()

* chore(developer): new GetCompilerErrorString() used in AddCompileMessage()

* chore(developer): removed CWARN/CHINT out of CompMsg

* chore(developer): adapted kmcompxtest to test kmn-files that have errors included

* chore(developer): changed gitignore

* chore(developer): changed gitignore

* chore(developer): changed Version Number fot Tests 15.0.265.0 -> 15.0.270.0

* chore(developer): added tests for kmcompx

* chore(developer): move tests (for ErrorMessages) to common/test/keyboards

* chore(developer): move CERR-tests into test/keyboards/invalid

* chore(developer): change mostly whitespace changes

* chore(developer): change mostly whitespace changes

* chore(developer): delete files of keyboards/kmcompx_tests

* chore(developer): include check for correct Filename + rename var + change whitespace changes

* chore(developer): revert changes in AddCompileMessage, tidy up CreateTempFile

* chore(developer): remove python from meson.build

* chore(developer): change ErrExtra, change CompileMsg, change _finddata in FileExists

* chore(developer): check for '_' after Errornumber in Filename

* chore(developer): re-include AddCompilerVersionStore in Compiler.cpp

* chore(developer): add Message CERR_InvalidCharacter to UTF16TempFromUTF8() ; change #include <> -> ""

* chore(developer): add some more keyboardtests

* chore(developer): add some more keyboardtests

* chore(developer): change remaining old datatype-names to new names ( e.g. char -> KMX_CHAR )

* chore(developer): edit + add CERR_tests

* chore(developer): edit + add CERR_tests

* chore(developer): use char16_t in CheckFileNameConsistency

* chore(developer): comments: converting functions in kmx_u16

* chore: reorganize

* chore: commit kmcompx-files

* chore: use ifdef for vkeys

* chore: copy files back

* chore: more cleanup

* chore: meson build for kmcmplib

* chore: tweak unit test, error messages, and paths

* chore(developer): make kmcmplib a static library

* chore(developer): start kmcmpdll link to kmcmplib

* chore(developer): add build.sh for kmcmplib

* chore(developer): link kmcmpdll to kmcmplib

* chore(common): avoid building 'invalid' shared keyboards

* chore(developer): include BEGIN_LINE (repeated Begin)

* chore(developer): add more CERR_tests and move some to other folder, edit readme

* chore(developer): addCompilerMsg for RepeatedBegin

* chore(developer):repeatedBEgin plus rename functions to prevent same names in kmcmpdll and kmcmplib

* chore(developer): add flag flag_use_kmcompx as switch to use old code (kmcmpdll) or new code kmcmplib

* chore(developer): introduce namespace kmcmp instead of different filenames

* chore(developer): more changes for using namespaces

* chore(developer): solve merge conflicts in namespaces

* chore(developer): use namespaces in kmcmplib (except for in dllexport-functions)

* chore(developer): remove some unnecessary CERR_ tests

* chore(developer): remove CERR_CallIsProfessionalFeature, CERR_IncludeCodesIsProfessionalFeature, CERR_MnemonicLayoutIsProfessionalFeature

* chore(developer): note about func.call_js; change all "VESION x.y " to "VESION x.y or higher" ; rename flag for kmcompx to flag_use_new_kmcomp

* chore(developer): use PKMX_DWORD/PKMX_WCHAR   instead of LPKMX_DWORD/LPKMX_WCHAR; use PKMX_STR instead of char* in CompilerMessageProc

* chore(developer): remove kmx-file; NamedCodeConstants: rename variables, set const variables for buf sizes, brackets in for-loops

* chore(developer): change include paths ../

* chore(developer): get rid of reopened namespaces of kmcmp

* chore(developer): restored kmcompxtest

* chore(developer): change #include paths ../ ; excange km_kbp_cp with KMX_WCHAR; change some variable names

* chore(developer): use environment var KEYMAN_ROOT in path for tests; remove try-catch from json-validation.cpp

* chore(developer): use environment var KEYMAN_ROOT in path for tests; remove try-catch from json-validation.cpp

* chore(developer): revert change in NamedCodeConstants

* chore(developer): restored kmcompxtest, adapted readme

* chore(developer): use res-fils/version.rc for kmcmplib

* chore(developer): rename some functions/variables

* chore(developer): typos, comments, add function u16rchr()

* chore(developer): typos, comments, add function u16rchr()

* chore(developer): rename Functions, version rc-files

* chore(developer): rename Functions, version rc-files, set flag_use_new_kmcomp to use (old) kmcmpdll

* chore(developer): add BeginLine in kmcmpdll/Compiler.cpp; fread() in kmcmp_CompileKeyboardFileToBuffer

* chore(developer): set flag_use_new_kmcomp to only use kmcmpdll

* chore(developer): set flag_use_new_kmcomp to only use kmcmpdll...and back to kmcmplib

* (chore(developer): set flag_use_new_kmcomp to only use kmcmpdll...and back

* (chore(developer): changes in NamedCodeConstants::reindex() to run hieroglyphic.kmn properly

* chore(developer): changes in UnrechableRules::VerifyUnreachableRules() to run test_6440_unreachable_code..kmn

* chore(developer): remove unneccessary files, get ErrorMsg for INCLUDECODES, VISUALKEYBOARD, UnreachableRules, ErrExrta

* chore(developer): remove unneccessary files, get ErrorMsg for INCLUDECODES, VISUALKEYBOARD, UnreachableRules, ErrExrta, CWARN_ OK

* chore(developer): after stash:remove unneccessary files, get ErrorMsg for INCLUDECODES, VISUALKEYBOARD, UnreachableRules, ErrExrta, CWARN_ OK

* chore(developer): replace some #include <> with "" ; rename ErrExtra -> ErrExtraW

* chore(developer): replace some #include <> with "" ; rename ErrExtra -> ErrExtraW

* chore(developer): new converting function convert_pchar16T_To_pwcharT in kmx_u16

* chore(developer): CheckFilenameConsistency added fclose()

* chore(developer): --

* chore(developer): removed printf (---> started in... / °°-> changed to...)

* chore(developer): AddDeprecatedCode to get CWARN when in kmcomp.exe -s-w is set

* chore(developer): change MakeHashKeyFromFileKey16() to get correct behaviour of CHINT

* chore(developer): change MakeHashKeyFromFileKey16() to get correct behaviour of CHINT

* chore(developer): move converting function to kmx_u16

* chore(developer): add more CERR_ tests

* chore(developer): Not ready yet: changes in CheckFilenameConsistency to use on non-windows

* chore(developer): Not ready yet: changes in CheckFilenameConsistency to use on non-windows

* chore(developer): copied contents of 3 files of commit fcfc6c698a to here to achieve state of fcfc6c698a

* chore(developer): copied contents of 3 files of commit fcfc6c698a to here to achieve state of fcfc6c698a

* chore(developer): move/rename converting functions

* chore(developer) : update .gitignore, remove converting function

* chore(developer) : update gitignore; sort code in CheckFilenameConsistency::CheckFilenameConsistency()

* chore(developer) : change Version number 15.0.270 -> 17.0.51

* chore(developer): change #includes, path in meson.build

* chore(developer): new function Open_File() to open files on windows and non-windows platforms

* chore(developer): create Function to replace fopen/_wfsopen

* chore(developer): exclude kmx, kvk from git

* chore(developer): exclude kmx, kvk from git

* chore(developer): change #includes to include from kmcmplib

* chore(developer): remove stray fopen

* chore(developer): include Open_File() (as comment for now)

* chore(developer): include Open_File() (as comment for now)

* chore(developer): remove path to kmcmpdll in include_directories

* chore(developer): use functin Open_File()

* chore(developer): remove #ifdef for '\\' and '/' in both IsRelativePath; remove Function Open_File again

* chore(developer): new fun  u16rchr_LinWin, strrchr_LinWin to exchange #ifndef for '\\' and '/'

* chore(developer): implement u16rchr_LinWin and strrchr_LinWin

* chore(developer): implement Open_File()

* chore(developer): new MakeHashKeyFromFileKey, remove comments for Open_File, & *LinWin-functions, delete 1 converting function

* chore(developer): tidy up comments

---------

Co-authored-by: Marc Durdin <marc@durdin.net>
2023-03-01 20:00:04 +11:00

163 lines
7.5 KiB
Markdown

# **Tests for kmcompxtest()**
<br/>
This folder contains several kmn-files that are used for testing resulting error codes.
Most of these tests are copied from balochi_phonetic and contain alterations of the data to produce (at least) 1 error.
<br/>
<br/>
## Naming Convention of kmn-files for using with kmcompxtest()
CERR_404D_balochi_phonetic.kmn
The naming convention of the files is as follows:
* All Files **MUST** start with CERR_ followed by 4 characters and an underscore.
* After the second underscore all combination of char can be used.
* The 4 characters following CERR_ correspond to the last 4 digits of the error code which is expected to be produced by this file.
( e.g. CERR_404D_balochi_phonetic.kmn should produce error 0x0000404D).
<br/>
<br/>
While running, kmcompxtest extracts those 4 characters from the Filename (e.g. 404D for CERR_404D_balochi_phonetic) and compares those to the actual error found.
* If these 4 characters correspond to the actual error given, the test will be marked as OK. (Code 0)
<br/>
* If these 4 characters signify an error but **no error** does occur, the test will be marked as FAILED (Code 1)
<br/>
* If these 4 characters signify an error but this **specific error** does not occur, the test will be marked as FAILED (Code 4)
<br/>
* If these 4 characters signify an error number that is **not correct**, the test will be marked as FAILED (Code 5)
<br/>
* If more than 1 error is produced, only the error coded in the Filename will be detected
<br/>
<br/>
### Tests are available for the following CERR_:
<font size="1">
| | Error Number | CERR_
| :-: | :-----------:| :-------------------------------------
| | 00000800 | CERR_LEXICAL_MODEL_MIN
| | 000008FF | CERR_LEXICAL_MODEL_MAX
| | 00000800 | CERR_LEXICAL_MODEL_MIN
| | 000008FF | CERR_LEXICAL_MODEL_MAX
| | 00000000 | CERR_None
| | 00000001 | CERR_EndOfFile
| | 00008002 | CERR_BadCallParams
| | 00008004 | CERR_CannotAllocateMemory
| | 00008005 | CERR_InfileNotExist
| | 00008006 | CERR_CannotCreateOutfile
| | 00008007 | CERR_UnableToWriteFully
| | 00008008 | CERR_CannotReadInfile
| | 00008009 | CERR_SomewhereIGotItWrong
|**X**| 0000400A | CERR_InvalidToken
| | 0000400B | CERR_InvalidBegin
| | 0000400C | CERR_InvalidName
|**X**| 0000400D | CERR_InvalidVersion
|**X**| 0000400E | CERR_InvalidLanguageLine
| | 0000400F | CERR_LayoutButNoLanguage
| | 00004010 | CERR_InvalidLayoutLine
| | 00004011 | CERR_NoVersionLine
| | 00004012 | CERR_InvalidGroupLine
|**X**| 00004013 | CERR_InvalidStoreLine
| | 00004014 | CERR_InvalidCodeInKeyPartOfRule
|**X**| 00004015 | CERR_InvalidDeadkey
|**X**| 00004016 | CERR_InvalidValue
|**X**| 00004017 | CERR_ZeroLengthString
| | 00004018 | CERR_TooManyIndexToKeyRefs
|**X**| 00004019 | CERR_UnterminatedString
| | 0000401A | CERR_StringInVirtualKeySection
| | 0000401B | CERR_AnyInVirtualKeySection
| | 0000401C | CERR_InvalidAny
|**X**| 0000401D | CERR_StoreDoesNotExist
| | 0000401E | CERR_BeepInVirtualKeySection
| | 0000401F | CERR_IndexInVirtualKeySection
| | 00004020 | CERR_InvalidIndex
| | 00004021 | CERR_OutsInVirtualKeySection
| | 00004022 | CERR_InvalidOuts
| | 00004024 | CERR_ContextInVirtualKeySection
| | 00004025 | CERR_InvalidUse
|**X**| 00004026 | CERR_GroupDoesNotExist
| | 00004027 | CERR_VirtualKeyNotAllowedHere
| | 00004028 | CERR_InvalidSwitch
|**X**| 00004029 | CERR_NoTokensFound
| | 0000402A | CERR_InvalidLineContinuation
|**X**| 0000402B | CERR_LineTooLong
| | 0000402C | CERR_InvalidCopyright
|**X**| 0000402D | CERR_CodeInvalidInThisSection
| | 0000402E | CERR_InvalidMessage
| | 0000402F | CERR_InvalidLanguageName
| | 00004030 | CERR_InvalidBitmapLine
|**X**| 00004031 | CERR_CannotReadBitmapFile
| | 00004032 | CERR_IndexDoesNotPointToAny
| | 00004033 | CERR_ReservedCharacter
|**X**| 00004034 | CERR_InvalidCharacter
| | 00004035 | CERR_InvalidCall
| | 00004036 | CERR_CallInVirtualKeySection
| | 00004037 | CERR_CodeInvalidInKeyStore
|**X**| 00004038 | CERR_CannotLoadIncludeFile
|**X**| 00004039 | CERR_60FeatureOnly_EthnologueCode
|**X**| 0000403A | CERR_60FeatureOnly_MnemonicLayout
| | 0000403B | CERR_60FeatureOnly_OldCharPosMatching
| | 0000403C | CERR_60FeatureOnly_NamedCodes
| | 0000403D | CERR_60FeatureOnly_Contextn
|**X**| 0000403E | CERR_501FeatureOnly_Call
| | 0000403F | CERR_InvalidNamedCode
|**X**| 00004040 | CERR_InvalidSystemStore
|**X**| 00004044 | CERR_60FeatureOnly_VirtualCharKey
|**X**| 00004045 | CERR_VersionAlreadyIncluded
|**X**| 00004046 | CERR_70FeatureOnly
|**X**| 00004047 | CERR_80FeatureOnly
| | 00004048 | CERR_InvalidInVirtualKeySection
|**X**| 00004049 | CERR_InvalidIf
|**X**| 0000404A | CERR_InvalidReset
|**X**| 0000404B | CERR_InvalidSet
|**X**| 0000404C | CERR_InvalidSave
|**X**| 0000404D | CERR_InvalidEthnologueCode
| | 0000804E | CERR_CannotCreateTempfile
|**X**| 0000404F | CERR_90FeatureOnly_IfSystemStores
| | 00004050 | CERR_IfSystemStore_NotFound
| | 00004051 | CERR_90FeatureOnly_SetSystemStores
| | 00004052 | CERR_SetSystemStore_NotFound
| | 00004053 | CERR_90FeatureOnlyVirtualKeyDictionary
| | 00004054 | CERR_NotSupportedInKeymanWebContext
| | 00004055 | CERR_NotSupportedInKeymanWebOutput
| | 00004056 | CERR_NotSupportedInKeymanWebStore
| | 00004057 | CERR_VirtualCharacterKeysNotSupportedInKeymanWeb
| | 00004058 | CERR_VirtualKeysNotValidForMnemonicLayouts
| | 00004059 | CERR_InvalidTouchLayoutFile
| | 0000405A | CERR_TouchLayoutInvalidIdentifier
| | 0000405B | CERR_InvalidKeyCode
|**X**| 0000405C | CERR_90FeatureOnlyLayoutFile
|**X**| 0000405D | CERR_90FeatureOnlyKeyboardVersion
|**X**| 0000405E | CERR_KeyboardVersionFormatInvalid
| | 0000405F | CERR_ContextExHasInvalidOffset
|**X**| 00004060 | CERR_90FeatureOnlyEmbedCSS
|**X**| 00004061 | CERR_90FeatureOnlyTargets
| | 00004062 | CERR_ContextAndIndexInvalidInMatchNomatch
| | 00004063 | CERR_140FeatureOnlyContextAndNotAnyWeb
|**X**| 00004064 | CERR_ExpansionMustFollowCharacterOrVKey
|**X**| 00004065 | CERR_VKeyExpansionMustBeFollowedByVKey
|**X**| 00004066 | CERR_CharacterExpansionMustBeFollowedByCharacter
|**X**| 00004067 | CERR_VKeyExpansionMustUseConsistentShift
|**X**| 00004068 | CERR_ExpansionMustBePositive
|**X**| 00004069 | CERR_CasedKeysMustContainOnlyVirtualKeys
|**X**| 0000406A | CERR_CasedKeysMustNotIncludeShiftStates
|**X**| 0000406B | CERR_CasedKeysNotSupportedWithMnemonicLayout
|**X**| 0000406C | CERR_CannotUseReadWriteGroupFromReadonlyGroup
| | 0000406D | CERR_StatementNotPermittedInReadonlyGroup
|**X**| 0000406E | CERR_OutputInReadonlyGroup
|**X**| 0000406F | CERR_NewContextGroupMustBeReadonly
|**X**| 00004070 | CERR_PostKeystrokeGroupMustBeReadonly
|**X**| 00004071 | CERR_DuplicateGroup
|**X**| 00004072 | CERR_DuplicateStore
|**X**| 00004073 | CERR_RepeatedBegin
|**X**| 000080C0 | CERR_BufferOverflow