Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
Find a file
Marc Durdin d71cb56ca7 fix(core): rename assert() to test_assert() in unit tests
Had a real yak shave this morning with disabling assertions in release
builds in our C/C++ code. It turns out that our unit tests use
`assert()` which we intended to use from `test_assert.h`, but in some
cases `cassert` or `assert.h` had been #included after `test_assert.h`,
overriding our special `assert()` macro. The chain of includes is
somewhat hard to puzzle out -- it's often buried several levels deep.
This meant that a release build would drop all test assertions, meaning
most tests passed, unsurprisingly, as there were no assertions left to
fail ... but some tests failed with crashes because we optimized out
important lines such as `assert(some_important_function())`.

I was quite unhappy with this fragility, so I have opted to rename
`assert()` to `test_assert()` in all of our home-grown C/C++ unit tests,
which further highlighted unit tests which were only using the C/C++
`assert()` and not ours, so then had to figure out which unit test
executables needed to have `test_assert` added, and then ... then ...
discovered a bug in `test_color.h`, where we were #including
`io.h`/`unistd.h` inside a `namespace console_color {}` block, which
just happened to be the first ref to those beautiful headers, and thus
(because `#pragma once`) meant that useful little functions like
`access()` were no longer accessible to us in the global namespace.

I have also audited Every Single Call to `assert()` to verify that we do
not do Important Work inside the parentheses, and, apart from those
offending unit tests, now resolved with `test_assert()`, it looks like
all is good.

I would like to present one very well-shaved yak in this commit.

Fixes: #12619
2024-11-28 09:46:01 +07:00
.github chore(linux): add support for Ubuntu 25.04 Plucky Puffin 2024-11-14 19:31:53 +01:00
android chore: update minimum versions 2024-11-06 11:14:59 +07:00
common fix(core): rename assert() to test_assert() in unit tests 2024-11-28 09:46:01 +07:00
core fix(core): rename assert() to test_assert() in unit tests 2024-11-28 09:46:01 +07:00
developer fix(core): rename assert() to test_assert() in unit tests 2024-11-28 09:46:01 +07:00
docs docs(windows): update emscripten bash setup 2024-11-26 15:13:16 +10:00
ios refactor(ios): move ios Engine help in-repo 2024-10-31 10:13:00 +07:00
linux chore(core): avoid skipping docs folder in linux dist.sh 2024-11-08 05:24:47 +07:00
mac fix(mac): rename properties and variables 2024-10-21 15:21:47 +07:00
oem/firstvoices fix(windows): correct path to output file in publish step for fv keyboards 2024-11-07 06:03:57 +07:00
resources chore(common): define NDEBUG for release builds to disable assertions on all platforms 2024-11-28 09:41:14 +07:00
web refactor(common): move all lexical model types into LexicalModelTypes container 2024-11-27 09:46:09 +07:00
windows fix(windows): stupid typo 2024-11-11 09:03:40 +10:00
.clang-format chore(common): update C/C++ formatting options 2024-06-19 20:19:12 +02:00
.editorconfig chore(linux): Address a few more lintian warnings 2022-03-15 15:32:10 +01:00
.eslintrc.cjs chore(developer): add eslint devDependency for kmc 2023-04-25 13:44:56 +07:00
.flake8 chore(linux): Add integration tests for ibus-keyman 2021-11-04 09:22:28 +01:00
.gitignore chore(common): create flag file without node 2024-09-30 14:51:24 +02:00
.nycrc.json feat(developer): fixup and prepare build scripts and docs for kmc 2022-09-19 06:36:06 +10:00
.shellcheckrc chore(linux): Properly fix shellcheck SC1091 warnings 2023-05-11 11:59:15 +02:00
build.sh feat(common): add top-level build.sh 2024-08-07 10:46:39 +07:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2021-10-08 10:46:53 +11:00
configure-repo.sh chore: update docs and non-standard readlink refs 2023-02-22 10:41:54 +07:00
CONTRIBUTING.md chore(common): Add link to onboarding doc to CONTRIBUTING.md 2024-11-25 16:11:12 +01:00
crowdin.yml fix(mac): Specify el.lproj folders 2024-08-07 10:01:42 +07:00
HISTORY.md auto: increment master version to 18.0.146 2024-11-26 13:01:27 -05:00
LICENSE.md chore: rename SIL International to SIL Global 2024-08-13 12:04:53 +08:00
package-lock.json chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 2024-11-22 08:51:07 +00:00
package.json feat(developer): seed kmc-copy 2024-10-22 10:28:00 +07:00
README.md chore: rename SIL International to SIL Global 2024-08-13 12:04:53 +08:00
TIER.md Update TIER.md 2022-11-14 07:34:26 +11:00
tsconfig.base.json refactor(web): move common/web/utils to web/src/engine/common/web-utils/ 2024-09-10 18:12:46 +02:00
tsconfig.json feat(developer): seed kmc-copy 2024-10-22 10:28:00 +07:00
VERSION.md auto: increment master version to 18.0.146 2024-11-26 13:01:27 -05:00

Keyman

Keyman makes it possible for you to type in any language on Windows, macOS, Linux, iPhone, iPad, Android tablets and phones, and even instantly in your web browser. Create keyboard layouts with Keyman Developer and share them with the community in the keyboards repository. The Keyman Community have already contributed keyboard layouts for over 2,000 languages!

License

Copyright (c) SIL Global.

Keyman is an open source project distributed under the MIT license.

Get Involved

Development Status

Important Links