wxGTK-3.2.2.1-backport-pr24197.patch 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. https://bugs.gentoo.org/916884
  2. https://github.com/wxWidgets/wxWidgets/pull/24197
  3. From 891bfff867b7dc92ed6330ea46ee2dcfa5424ee0 Mon Sep 17 00:00:00 2001
  4. From: Cliff Zhao <qzhao@suse.com>
  5. Date: Thu, 4 Jan 2024 08:01:00 +0100
  6. Subject: [PATCH] Fix testsuite failures on s390x
  7. ``/sys/power/state`` does not exist on s390x platforms and certain
  8. types of containers, so check that the file exist before running the
  9. test case.
  10. Output from ``make check`` was:
  11. ./textfile/textfiletest.cpp:351
  12. ...............................................................................
  13. ./textfile/textfiletest.cpp:354: FAILED:
  14. CHECK( f.Open("/sys/power/state") )
  15. with expansion:
  16. false
  17. ./textfile/textfiletest.cpp:355: FAILED:
  18. REQUIRE( f.GetLineCount() == 1 )
  19. with expansion:
  20. 0 == 1
  21. ---
  22. tests/file/filetest.cpp | 2 ++
  23. tests/filename/filenametest.cpp | 2 ++
  24. tests/textfile/textfiletest.cpp | 2 ++
  25. 3 files changed, 6 insertions(+)
  26. diff --git a/tests/file/filetest.cpp b/tests/file/filetest.cpp
  27. index 8902eb4d6684..fc3c90569480 100644
  28. --- a/tests/file/filetest.cpp
  29. +++ b/tests/file/filetest.cpp
  30. @@ -153,6 +153,7 @@ TEST_CASE("wxFile::Special", "[file][linux][special-file]")
  31. CHECK( fileProc.ReadAll(&s) );
  32. CHECK( !s.empty() );
  33. + if ( wxFile::Exists("/sys/power/state") ) {
  34. // All files in /sys have the size of one kernel page, even if they don't
  35. // have that much data in them.
  36. const long pageSize = sysconf(_SC_PAGESIZE);
  37. @@ -163,6 +164,7 @@ TEST_CASE("wxFile::Special", "[file][linux][special-file]")
  38. CHECK( fileSys.ReadAll(&s) );
  39. CHECK( !s.empty() );
  40. CHECK( s.length() < pageSize );
  41. + }
  42. }
  43. #endif // __LINUX__
  44. diff --git a/tests/filename/filenametest.cpp b/tests/filename/filenametest.cpp
  45. index 84356b39f719..ce2ec2af2760 100644
  46. --- a/tests/filename/filenametest.cpp
  47. +++ b/tests/filename/filenametest.cpp
  48. @@ -1040,9 +1040,11 @@ TEST_CASE("wxFileName::GetSizeSpecial", "[filename][linux][special-file]")
  49. INFO( "size of /proc/kcore=" << size );
  50. CHECK( size > 0 );
  51. + if ( wxFile::Exists("/sys/power/state") ) {
  52. // All files in /sys are one page in size, irrespectively of the size of
  53. // their actual contents.
  54. CHECK( wxFileName::GetSize("/sys/power/state") == sysconf(_SC_PAGESIZE) );
  55. + }
  56. }
  57. #endif // __LINUX__
  58. diff --git a/tests/textfile/textfiletest.cpp b/tests/textfile/textfiletest.cpp
  59. index f744ffc3271b..73467be8f85f 100644
  60. --- a/tests/textfile/textfiletest.cpp
  61. +++ b/tests/textfile/textfiletest.cpp
  62. @@ -348,6 +348,7 @@ TEST_CASE("wxTextFile::Special", "[textfile][linux][special-file]")
  63. CHECK( f.GetLineCount() > 1 );
  64. }
  65. + if ( wxFile::Exists("/sys/power/state") ) {
  66. SECTION("/sys")
  67. {
  68. wxTextFile f;
  69. @@ -356,6 +357,7 @@ TEST_CASE("wxTextFile::Special", "[textfile][linux][special-file]")
  70. INFO( "/sys/power/state contains \"" << f[0] << "\"" );
  71. CHECK( (f[0].find("mem") != wxString::npos || f[0].find("disk") != wxString::npos) );
  72. }
  73. + }
  74. }
  75. #endif // __LINUX__