Fix tests when run on ppc64le arch

Don't assume that files in /sys are 4KiB in size, their actual size is
equal to the kernel page size which varies depending on the architecture
and kernel build options.
This commit is contained in:
Scott Talbert
2020-04-07 01:48:38 +02:00
committed by Vadim Zeitlin
parent 3afc68bb63
commit b2b1b21bf2
2 changed files with 2 additions and 2 deletions

View File

@@ -159,7 +159,7 @@ TEST_CASE("wxFile::Special", "[file][linux][special-file]")
// All files in /sys seem to have size of 4KiB currently, even if they
// don't have that much data in them.
wxFile fileSys("/sys/power/state");
CHECK( fileSys.Length() == 4096 );
CHECK( fileSys.Length() == sysconf(_SC_PAGESIZE) );
CHECK( fileSys.IsOpened() );
CHECK( fileSys.ReadAll(&s) );
CHECK( !s.empty() );

View File

@@ -1060,7 +1060,7 @@ TEST_CASE("wxFileName::GetSizeSpecial", "[filename][linux][special-file]")
CHECK( size > 0 );
// All files in /sys seem to have size of 4KiB currently.
CHECK( wxFileName::GetSize("/sys/power/state") == 4096 );
CHECK( wxFileName::GetSize("/sys/power/state") == sysconf(_SC_PAGESIZE) );
}
#endif // __LINUX__