[swift-corelibs-dev] How to crash swift core libs foundation tests ? By Setting a locale before executing test suite

Benoit Pereira da silva bpds at me.com
Fri Dec 22 04:18:09 CST 2017


Dear Core Devs, 


There is a vicious bug in Darwin’s Objc implementation of JSON number encoding that irritates the president Macron :) this fact is well established. (check SR-6631 <https://bugs.swift.org/browse/SR-6631> for details) 
But there is more, i've found an interesting variante that demonstrates that an equivalent issue exists in the Swift Core Foundations.

How to reproduce some correlated issues in swift-corelibs-foundation ? 

1- write `setlocale(LC_ALL,"fr_FR »)` in `swift-corelibs-foundation/TestFoundation/main.swift`
2- Run the tests. => The unit tests will crash. https://clients.pereira-da-silva.com/apple/core-lib-test-crash.png <https://clients.pereira-da-silva.com/apple/core-lib-test-crash.png>

Setting a locale globally before running tests is not a normal procedure, but i do maintain that all critical test suites should be tested against a bunch of Locales to determinate possible localization impact.
I think that running at least all the tests suites once with various locales would enable to determinate if there are other blind spots.
When those spot will be clearly located we could apply a systematic multi local testing procedure to specific code areas to reduce the tests loads.

Best regards,

PS: @chris, you are in copy of this mail because  i would appreciate to have your opinion on a what  general testing strategy we could apply to prevent internationalization blind spot issues.




Benoit Pereira da Silva
Ultra Mobile Developer & Movement Activist
Développeur Ultra Mobile & Militant du mouvement
https://pereira-da-silva.com





✄ --------------------------------
This e-mail is confidential. Distribution, copy, publication or use of this information for any purpose is prohibited without agreement of the sender.
Ce message est confidentiel. Toute distribution, copie, publication ou usage des informations contenues dans ce message sont interdits sans agrément préalable de l'expéditeur.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20171222/8ed49cb7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bannerp.jpg
Type: image/jpeg
Size: 27829 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20171222/8ed49cb7/attachment.jpg>


More information about the swift-corelibs-dev mailing list