Lolly 1.4.27
Loading...
Searching...
No Matches
Functions
sys_utils_test.cpp File Reference
#include "a_lolly_test.hpp"
#include "sys_utils.hpp"
Include dependency graph for sys_utils_test.cpp:

Go to the source code of this file.

Functions

TEST_MEMORY_LEAK_INIT TEST_CASE ("get_process_id")
 
 TEST_CASE ("get_env/set_env")
 
 TEST_CASE ("get_user_name")
 
 TEST_CASE ("get_stacktrace")
 

Function Documentation

◆ TEST_CASE() [1/4]

TEST_MEMORY_LEAK_INIT TEST_CASE ( "get_process_id" )

Definition at line 6 of file sys_utils_test.cpp.

6{ CHECK (get_process_id () >= 1); }
The list class represents a linked list.
Definition list.hpp:48
SN get_process_id()

◆ TEST_CASE() [2/4]

TEST_CASE ( "get_env/set_env" )

Definition at line 8 of file sys_utils_test.cpp.

8 {
9#if defined(OS_MINGW) || defined(OS_WIN)
10 CHECK_EQ (get_env ("ProgramFiles") == "C:\\Program Files", true);
11 set_env ("LOLLY_PATH", "C:\\lolly");
12 CHECK_EQ (get_env ("LOLLY_PATH") == "C:\\lolly", true);
13#endif
14
15 set_env ("SHELL", "/bin/zsh");
16 CHECK_EQ (get_env ("SHELL") == "/bin/zsh", true);
17}
void set_env(string var, string with)
Definition sys_utils.cpp:49
string get_env(string var)
Definition sys_utils.cpp:25

◆ TEST_CASE() [3/4]

TEST_CASE ( "get_user_name" )

Definition at line 19 of file sys_utils_test.cpp.

19 {
20 CHECK (N (get_user_name ()) >= 0);
21 // cout << get_user_name () << LF;
22}
int N(array< T > a)
Get the length of the array.
Definition array.hpp:170
string get_user_name()
Definition sys_utils.cpp:79

◆ TEST_CASE() [4/4]

TEST_CASE ( "get_stacktrace" )

Definition at line 24 of file sys_utils_test.cpp.

24 {
25 CHECK (N (lolly::get_stacktrace (10)) >= 0);
26 cout << lolly::get_stacktrace (10) << LF;
27}
@ LF
Definition basic.hpp:287
string get_stacktrace(unsigned int max_frames)
tm_ostream & cout