2018-01-18 03:37:34 +03:00
|
|
|
add_executable(tests
|
2019-01-25 20:16:23 +03:00
|
|
|
common/bit_field.cpp
|
2021-02-18 06:43:42 +03:00
|
|
|
common/cityhash.cpp
|
2020-02-05 21:13:16 +03:00
|
|
|
common/fibers.cpp
|
2021-06-05 10:16:32 +03:00
|
|
|
common/host_memory.cpp
|
2018-01-18 03:37:34 +03:00
|
|
|
common/param_package.cpp
|
2018-09-08 16:28:39 +03:00
|
|
|
common/ring_buffer.cpp
|
2018-01-18 03:37:34 +03: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 23:17:02 +03:00
|
|
|
core/network/network.cpp
|
2018-01-18 03:37:34 +03:00
|
|
|
tests.cpp
|
2020-12-31 00:42:27 +03:00
|
|
|
video_core/buffer_base.cpp
|
2018-01-18 03:37:34 +03:00
|
|
|
)
|
2016-03-20 17:58:24 +03:00
|
|
|
|
2018-01-18 03:37:34 +03:00
|
|
|
create_target_directory_groups(tests)
|
2016-03-20 17:58:24 +03:00
|
|
|
|
2017-05-28 04:26:55 +03:00
|
|
|
target_link_libraries(tests PRIVATE common core)
|
2017-05-28 08:46:59 +03:00
|
|
|
target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} catch-single-include Threads::Threads)
|
2016-05-19 20:54:50 +03:00
|
|
|
|
2017-05-28 08:46:59 +03:00
|
|
|
add_test(NAME tests COMMAND tests)
|