Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(developer): kmcmplib compiler unit tests 5 #12612

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

markcsinclair
Copy link
Contributor

@markcsinclair markcsinclair commented Nov 4, 2024

Google Test based unit tests for Compiler.cpp

As it was identified that no recursive call was made to GetXStringImpl() from within the virtual key case (case 11), the checks (Compiler.cpp) and resulting error messages (kmn_compiler_errors.h) when other keywords were identified within a virtual key section were stripped out. The error messages removed were:

  • ERROR_StringInVirtualKeySection
  • ERROR_AnyInVirtualKeySection
  • ERROR_BeepInVirtualKeySection
  • ERROR_IndexInVirtualKeySection
  • ERROR_OutsInVirtualKeySection
  • ERROR_ContextInVirtualKeySection
  • ERROR_CallInVirtualKeySection
  • ERROR_InvalidInVirtualKeySection

In addition, three variables relating to the parsing of virtual keys were localised by turning the case into a block.

The corresponding errors were also removed from kmn_compiler_messages.ts.

TODO comments in gtest-compiler-test.cpp were also removed.

A separate issue and fix were not written, but the compiler changes incorporated here.

Continues PR #12489

@keymanapp-test-bot skip

@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Nov 4, 2024

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

@markcsinclair markcsinclair self-assigned this Nov 4, 2024
@keymanapp-test-bot keymanapp-test-bot bot added this to the A18S14 milestone Nov 4, 2024
@markcsinclair markcsinclair marked this pull request as draft November 4, 2024 10:31
@darcywong00 darcywong00 modified the milestones: A18S14, A18S15 Nov 9, 2024
@darcywong00 darcywong00 modified the milestones: A18S15, A18S16 Nov 24, 2024
@markcsinclair
Copy link
Contributor Author

markcsinclair commented Nov 26, 2024

Ready to review

P;ease note that the code for case 11 in Compiler.cpp is not changed as much as it appears - github has failed to spot the main change is just indentation by one level as it has been converted into a block.

@markcsinclair markcsinclair marked this pull request as ready for review November 26, 2024 07:24
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice little cleanup


sFlag = 0;
sFlag = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sFlag = 0;

nit only 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants