2018-01-18 01:37:34 +01:00
|
|
|
add_executable(tests
|
2019-01-25 18:16:23 +01:00
|
|
|
common/bit_field.cpp
|
2021-02-18 04:43:42 +01:00
|
|
|
common/cityhash.cpp
|
2020-02-05 19:13:16 +01:00
|
|
|
common/fibers.cpp
|
2021-06-05 09:16:32 +02:00
|
|
|
common/host_memory.cpp
|
2018-01-18 01:37:34 +01:00
|
|
|
common/param_package.cpp
|
2018-09-08 15:28:39 +02:00
|
|
|
common/ring_buffer.cpp
|
2021-04-01 06:03:25 +02:00
|
|
|
common/unique_function.cpp
|
2018-01-18 01:37:34 +01:00
|
|
|
core/core_timing.cpp
|
[network] Error handling reform
`network.cpp` has several error paths which either:
- report "Unhandled host socket error=n" and return `SUCCESS`, or
- switch on a few possible errors, log them, and translate them to
Errno; the same switch statement is copied and pasted in multiple
places in the code
Convert these paths to use a helper function `GetAndLogLastError`, which
is roughly the equivalent of one of the switch statements, but:
- handling more cases (both ones that were already in `Errno`, and a few
more I added), and
- using OS functions to convert the error to a string when logging, so
it'll describe the error even if it's not one of the ones in the
switch statement.
- To handle this, refactor the logic in `GetLastErrorMsg` to expose a
new function `NativeErrorToString` which takes the error number
explicitly as an argument. And improve the Windows version a bit.
Also, add a test which exercises two random error paths.
2021-01-24 21:17:02 +01:00
|
|
|
core/network/network.cpp
|
2018-01-18 01:37:34 +01:00
|
|
|
tests.cpp
|
2020-12-30 22:42:27 +01:00
|
|
|
video_core/buffer_base.cpp
|
2018-01-18 01:37:34 +01:00
|
|
|
)
|
2016-03-20 15:58:24 +01:00
|
|
|
|
2018-01-18 01:37:34 +01:00
|
|
|
create_target_directory_groups(tests)
|
2016-03-20 15:58:24 +01:00
|
|
|
|
2017-05-28 03:26:55 +02:00
|
|
|
target_link_libraries(tests PRIVATE common core)
|
2017-05-28 07:46:59 +02:00
|
|
|
target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} catch-single-include Threads::Threads)
|
2016-05-19 19:54:50 +02:00
|
|
|
|
2017-05-28 07:46:59 +02:00
|
|
|
add_test(NAME tests COMMAND tests)
|