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 failure: com.vrem.wifianalyzer.wifi.band.WifiChannelCountryTest.testFindCorrectlyPopulatesCountryCodeAndName fails depending on the OS language #358

Closed
jswolf19 opened this issue Oct 2, 2021 · 4 comments
Assignees
Labels

Comments

@jswolf19
Copy link

jswolf19 commented Oct 2, 2021

I'm getting a failure on the test testFindCorrectlyPopulatesCountryCodeAndName, specifically the assertion that expected.displayCountry does not equal actual.countryName(expected).

I'm not sure what is expected with this assertion (or why it is necessary to test), nor do I know why it does not behave as expected in my environment.

I'm running Windows 10 20H2 19042.1266, android studio 2020.3.1 Patch 2, adoptopenjdk 11.0.12.7-hotspot

@jswolf19
Copy link
Author

jswolf19 commented Oct 2, 2021

It seems that my OS language being Japanese is also relevant. When I switch it to English, the test passes.

@jswolf19 jswolf19 changed the title Test failure: com.vrem.wifianalyzer.wifi.band.WifiChannelCountryTest.testFindCorrectlyPopulatesCountryCodeAndName Test failure: com.vrem.wifianalyzer.wifi.band.WifiChannelCountryTest.testFindCorrectlyPopulatesCountryCodeAndName fails depending on the OS language Oct 2, 2021
@jswolf19
Copy link
Author

jswolf19 commented Oct 3, 2021

I can see four options.

  1. Leave it as is. While not what I would prefer (as I'm affected by this), it would seem that either current contributors are not affected, or they don't consider it an issue.
  2. Remove the assertion. Only a guess, but it's likely just there to show that the country name is in the locale provided and not the display locale.
  3. Change the expected value to expected.getDisplayCountry(Locale.ENGLISH).
  4. Use Locale.setDefault(Locale.ENGLISH) to enforce that the display locale is not dependent on the environment. If tests are done in parallel, this could cause trouble elsewhere as this is changing global state.

@VREMSoftwareDevelopment
Copy link
Owner

Fixed

@jswolf19
Copy link
Author

@VREMSoftwareDevelopment fix confirmed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants