SRGSSR / srgletterbox-apple

The official SRG SSR media playback experience
https://srgssr.github.io/marketing/letterbox/
MIT License
14 stars 7 forks source link

Font registration assertion in unit tests #285

Closed defagos closed 2 years ago

defagos commented 2 years ago

Functions marked with __attribute__((constructor)) can be called multiple times in some cases.

When registering fonts we raise an assertion in case of failure, initially to detect whether some other component registered the same fonts we do. But when adding the library to a unit test target the constructor, called twice, will assert the second time font registration is attempted.

Note that using dispatch_once does not work to prevent multiple execution in this case, it is therefore likely simpler to just remove the assertion.

Issue type

Crash (in debug mode only)

Environment information

Reproducibility

Always reproducible

Code sample

Code sample

Steps to reproduce

  1. Open the sample project.
  2. Run the unit tests.
defagos commented 2 years ago

An SRG Appearance fix is required as well.