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:
committed by
Vadim Zeitlin
parent
3afc68bb63
commit
b2b1b21bf2
@@ -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
|
// All files in /sys seem to have size of 4KiB currently, even if they
|
||||||
// don't have that much data in them.
|
// don't have that much data in them.
|
||||||
wxFile fileSys("/sys/power/state");
|
wxFile fileSys("/sys/power/state");
|
||||||
CHECK( fileSys.Length() == 4096 );
|
CHECK( fileSys.Length() == sysconf(_SC_PAGESIZE) );
|
||||||
CHECK( fileSys.IsOpened() );
|
CHECK( fileSys.IsOpened() );
|
||||||
CHECK( fileSys.ReadAll(&s) );
|
CHECK( fileSys.ReadAll(&s) );
|
||||||
CHECK( !s.empty() );
|
CHECK( !s.empty() );
|
||||||
|
@@ -1060,7 +1060,7 @@ TEST_CASE("wxFileName::GetSizeSpecial", "[filename][linux][special-file]")
|
|||||||
CHECK( size > 0 );
|
CHECK( size > 0 );
|
||||||
|
|
||||||
// All files in /sys seem to have size of 4KiB currently.
|
// 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__
|
#endif // __LINUX__
|
||||||
|
Reference in New Issue
Block a user