File wxWidgets-3_2-Create-our-own-socket-file-for-socket-file-test.patch of Package wxWidgets-3_2
commit f172f53ac41021f57d96fabe2298520acaf45181
Author: Scott Talbert <swt@techie.net>
Date: Thu Feb 3 16:04:50 2022 -0500
Create our own socket file for socket file test
/dev/log doesn't exist in certain types of containers (e.g., Fedora's
build system). Additionally, this enables us to run this test on
platforms other than Linux.
Closes #22090.
diff -Nura wxWidgets-3.1.5/tests/filename/filenametest.cpp wxWidgets-3.1.5_new/tests/filename/filenametest.cpp
--- wxWidgets-3.1.5/tests/filename/filenametest.cpp 2021-04-13 06:23:58.000000000 +0800
+++ wxWidgets-3.1.5_new/tests/filename/filenametest.cpp 2023-12-29 19:17:35.886478412 +0800
@@ -21,6 +21,7 @@
#include "wx/filefn.h"
#include "wx/stdpaths.h"
#include "wx/scopeguard.h"
+#include "wx/sckipc.h"
#ifdef __WINDOWS__
#include "wx/msw/registry.h"
@@ -754,8 +755,14 @@
// These files are only guaranteed to exist under Linux.
// No need for wxFILE_EXISTS_NO_FOLLOW here; wxFILE_EXISTS_SYMLINK implies it
CPPUNIT_ASSERT( wxFileName::Exists("/proc/self", wxFILE_EXISTS_SYMLINK) );
- CPPUNIT_ASSERT( wxFileName::Exists("/dev/log", wxFILE_EXISTS_SOCKET) );
#endif // __LINUX__
+ wxString name = dirTemp.GetPath() + "/socktmpdirXXXXXX";
+ wxString socktempdir = wxString::From8BitData(mkdtemp(name.char_str()));
+ wxON_BLOCK_EXIT2(wxRmdir, socktempdir, 0);
+ wxString sockfile = socktempdir + "/socket";
+ wxTCPServer server;
+ server.Create(sockfile);
+ CHECK( wxFileName::Exists(sockfile, wxFILE_EXISTS_SOCKET) );
#ifndef __VMS
wxString fifo = dirTemp.GetPath() + "/fifo";
if (mkfifo(fifo.c_str(), 0600) == 0)