ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
globals.c File Reference

🔗 Global symbol stubs for test executables to satisfy linker dependencies More...

Go to the source code of this file.

Functions

 __attribute__ ((constructor))
 Test environment initialization (runs before main) Sets TESTING environment variable so libraries can detect test mode at runtime. This provides a fallback for when tests are run directly (not via ctest). CTest also sets TESTING=1 via set_tests_properties() in Tests.cmake. Options RCU access is safe before initialization and is initialized by the normal application/test startup path when options parsing is exercised.

Variables

atomic_t g_should_exit = {0}
 Global application exit flag (shared across all modes).

Detailed Description

🔗 Global symbol stubs for test executables to satisfy linker dependencies

Definition in file globals.c.

Function Documentation

◆ __attribute__()

__attribute__ ( (constructor) )

Test environment initialization (runs before main) Sets TESTING environment variable so libraries can detect test mode at runtime. This provides a fallback for when tests are run directly (not via ctest). CTest also sets TESTING=1 via set_tests_properties() in Tests.cmake. Options RCU access is safe before initialization and is initialized by the normal application/test startup path when options parsing is exercised.

Definition at line 22 of file globals.c.

22 {
23 platform_setenv("TESTING", "1");
24}
int platform_setenv(const char *name, const char *value)
Definition system.c:56

References platform_setenv().

Variable Documentation

◆ g_should_exit

atomic_t g_should_exit = {0}

Global application exit flag (shared across all modes).

Global shutdown flag referenced by lib/logging.c and lib/debug/lock.c In production builds, this is defined in main.c and set during shutdown. For tests, we stub it out as false (tests don't perform shutdown).

Definition at line 31 of file globals.c.

31{0};

Referenced by ATOMIC_INIT_AUTO(), client_audio_render_thread(), client_video_render_thread(), handle_image_frame_h265_packet(), handle_image_frame_packet(), server_main(), should_exit(), signal_exit(), and stats_logger_thread().