3682 Commits

Author SHA1 Message Date
Chris Thrasher
601b5032e7 Stop running tests that require network access 2025-02-18 14:28:38 -07:00
Jonny
c85ff6f011
Add catch2 argument to break into debugger when tests fail 2025-02-18 14:26:54 -07:00
JonnyPtn
068088233b Set required properties for ios test apps 2025-02-18 11:47:35 +00:00
Jonny
8c9ffe972f
Fix iOS debug build and update xcode 2025-02-17 09:29:06 -07:00
James Cowgill
91327373b0 Fix comments and address ordering in IpAddress::getLocalAddress
The old code says "The method here is to connect a UDP socket to
anyone (here to localhost)", but connecting to `localhost` doesn't
work because the connection would go via the loopback interface which
always has a local address of `127.0.0.1`.

The current code works on little-endian platforms due to a mistake in
the `createAddress` call. We pass `ntohl(INADDR_LOOPBACK)` as the IP,
but since `INADDR_LOOPBACK` is already in host order this actually
connects to `1.0.0.127`.

Fix the comments and intentionally connect to `1.1.1.1` (as a known
public IP address). This also fixes this call for big-endian
platforms.
2025-02-16 21:05:40 -07:00
FRex
f59913e997 Fix opening sf::Font from non-ASCII path 2025-02-14 03:47:44 -05:00
Jonny Paton
3a2b4518e2 Remove FLAC microbench target from project 2025-02-14 02:03:16 -05:00
Chris Thrasher
2241bee942 Fix saving FLAC files to non-ASCII paths 2025-02-13 16:12:47 -05:00
Chris Thrasher
41dc238981 Add portable abstraction for opening files from Unicode filepaths 2025-02-13 16:12:47 -05:00
Chris Thrasher
0eb92fc27d Use Catch2 generators to simplify tests 2025-02-07 07:59:51 -07:00
Chris Thrasher
a886fddbdb Add tests for sf::OutputSoundFile 2025-02-06 00:03:25 -07:00
Chris Thrasher
4c632e5775 Revamp sf::String tests 2025-02-05 14:04:44 -07:00
Chris Thrasher
505fe43d5a Use Unicode literals 2025-02-05 14:04:44 -07:00
Chris Thrasher
52ef7c9955 Test loading sf::SoundBuffer with non-ASCII filenames 2025-02-03 05:37:25 -07:00
Chris Thrasher
594eb408cb Test opening sf::Music with non-ASCII filenames 2025-02-03 05:37:25 -07:00
Chris Thrasher
645796f7fb Reenable exception printouts when tests fail
This option disables detailed exception information when an exception
is thrown in the tests.
2025-02-03 05:37:25 -07:00
Chris Thrasher
a45c4ecbcd Test opening sound files with non-ASCII filenames 2025-02-02 16:01:12 -07:00
Chris Thrasher
fd93e848f7 Test sf::FileInputStream::open with non-ASCII filepaths 2025-02-02 15:40:21 -07:00
Chris Thrasher
8d3bbe7cf8 Fix typo 2025-01-31 16:09:44 -07:00
Chris Thrasher
955b1ca541 Test for trivial move operations 2025-01-31 15:59:14 -07:00
Chris Thrasher
aee8707b1b Test loading shaders with non-ASCII filenames 2025-01-31 08:51:25 -07:00
Chris Thrasher
0a2e9ac340 Ensure sf::Image remains unchanged after an unsuccessful load 2025-01-31 05:54:22 -07:00
Chris Thrasher
355df11d09 Harden copyability tests to test for triviality 2025-01-30 17:33:28 -07:00
Chris Thrasher
7b0d72966b Reduce code duplication 2025-01-30 13:39:40 -07:00
FRex
9132655a3d Use std::fstream to support Unicode filenames in sf::Image #647 2025-01-30 10:16:03 -07:00
FRex
f7e904172f Add tests for Unicode filenames with sf::Image #647 2025-01-30 10:16:03 -07:00
FRex
7c60447a39 Always print filepaths as UTF-8 to a char stream #3406 2025-01-29 12:39:00 -07:00
Lukas Dürrenberger
4378a022e5 Silence C4275 warning for sf::Exception
Warning is not relevant when deriving from standard library types as the
documentation states:
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4275
2025-01-28 17:40:16 -07:00
kimci86
4c0b5b3df9 Implement support for references to handlers and function pointers 2025-01-27 12:21:41 -07:00
kimci86
efb207c849 Check that all WindowBase::handleEvents arguments handle some events 2025-01-27 12:21:41 -07:00
kimci86
23afdc2f9e More explicit naming for visit and handleEvents types and fix lint comments 2025-01-27 12:21:41 -07:00
kimci86
37c87ee11e Test Event::visit with move-only visitor 2025-01-25 13:10:56 -07:00
kimci86
c6df55eed8 Revert "Transform Event::visit signature to accept multiple handlers"
This reverts commit d64a222c869164933e1e53c4b58d73fc1db04eb3.
2025-01-25 13:10:56 -07:00
Pixel-Tony
d64a222c86 Transform Event::visit signature to accept multiple handlers 2025-01-24 09:39:52 -07:00
vittorioromeo
18393ea5cb Add non-const overload of Event::visit 2025-01-22 18:03:00 +01:00
Chris Thrasher
0e37e6dfee Use std::queue to model queues 2025-01-20 18:11:22 -07:00
Chris Thrasher
08bfae34e7 Fix build errors when compiling in C++20 mode
C++20 removes the ability to stream char32_t characters.
This is the error I get when setting CMAKE_CXX_STANDARD
to 20.

    /Users/thrasher/Projects/sfml/test/System/String.test.cpp:32:52: error: overload resolution selected deleted operator '<<'
       32 |     stream << "[\\x" << std::uppercase << std::hex << character << ']';
          |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/ostream:1009:31: note: candidate function [with _Traits = std::char_traits<char>] has been explicitly deleted
     1009 | basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char32_t) = delete;
          |                               ^
2025-01-20 11:27:43 +00:00
Chris Thrasher
97dfa7692d Use macOS 14 in more CI jobs 2025-01-18 19:12:52 -08:00
Chris Thrasher
662830e90a Fix conversion warning
Continuing what was started in #3381
2025-01-18 13:43:12 -08:00
kimci86
62a2a39650 Update copyright year to 2025 (continued) 2025-01-14 19:27:26 +00:00
Lukas Dürrenberger
68ce027b2e Update Catch2 to v3.8.0 2025-01-14 14:34:19 +00:00
Lukas Dürrenberger
ec42987cdf Update copyright year to 2025 2025-01-14 11:57:01 +00:00
Lukas Dürrenberger
4764c5104a Add a C++ language version check 2025-01-09 17:28:35 -07:00
Chris Thrasher
dfc9b83fe4 Suggest fix when incorrect library type is found by find_package
This is what it currently looks like when find_package(SFML) fails
due to locating the incorrect library type:

    CMake Error at <path>/<to>/lib/cmake/SFML/SFMLConfig.cmake:182 (message):
      Requested SFML configuration (Shared) was not found
    Call Stack (most recent call first):
      CMakeLists.txt:7 (find_package)

    CMake Error at CMakeLists.txt:7 (find_package):
      Found package configuration file:

        <path>/<to>/lib/cmake/SFML/SFMLConfig.cmake

      but it set SFML_FOUND to FALSE so package "SFML" is considered to be NOT
      FOUND.

After this change the "Requested SFML configuration" line is followed by either

    Set SFML_STATIC_LIBRARIES to ON for static libraries

or

    Set SFML_STATIC_LIBRARIES to OFF for shared libraries

depending on the value of SFML_STATIC_LIBRARIES. This should help clear up a
common source of confusion when users build SFML from source. The library
follows CMake convention of building static libraries by default but our
config module assumes shared libraries by default so those who build SFML
from source are prone to run into this error.
2025-01-09 21:57:10 +00:00
Lukas Dürrenberger
b56604c940 Use approximation when comparing floats in tests 2025-01-08 11:33:40 +00:00
Jonny Paton
722ab54f84 Use correct type for accessing array 2025-01-07 20:00:01 +00:00
Jonny Paton
8316c9e8d5 Make keyboard key/scancode count variables inline 2025-01-07 11:36:17 +00:00
Mark Jansen
bc268fbaea Remove unused RESOURCES_DIR cmake option 2025-01-04 18:08:47 -07:00
Jonny Paton
d4ff27caad Make pi/tau variables inline 2025-01-04 16:07:41 -07:00
Mark Jansen
74a460206c Remove unused prototype
The rest of the code was deleted in b39be46db028a825f321fa676ca8417fd9ab60d9
2025-01-04 16:07:16 -07:00