NegativePowersOfTen unit test: fix for ASCII

This commit is contained in:
nick black 2020-07-04 05:46:01 -04:00
parent efcf0583c9
commit 8f22a0a486
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -106,7 +106,6 @@ TEST_CASE("Metric") {
}
const char suffixes[] = "\0KMGTPE";
const wchar_t smallsuffixes[] = L"yzafpnµm";
SUBCASE("PowersOfTen") {
char gold[PREFIXSTRLEN + 1];
@ -420,6 +419,12 @@ TEST_CASE("Metric") {
}
SUBCASE("NegativePowersOfTen") {
const wchar_t* smallsuffixes;
if(enforce_utf8()){
smallsuffixes = L"yzafpnµm";
}else{
smallsuffixes = L"yzafpnum";
}
char gold[PREFIXSTRLEN + 1];
char buf[PREFIXSTRLEN + 1];
uintmax_t goldval = 1;
@ -439,7 +444,7 @@ TEST_CASE("Metric") {
}
}while(++i < (wcslen(smallsuffixes) - 3) * 3);
// If we ran through all our suffixes, that's a problem
CHECK(sizeof(smallsuffixes) / sizeof(*smallsuffixes) * 3 > i);
CHECK(wcslen(smallsuffixes) * 3 > i);
}
}