Lolly 1.4.28
Loading...
Searching...
No Matches
sys_utils_test.cpp
Go to the documentation of this file.
1#include "a_lolly_test.hpp"
2#include "sys_utils.hpp"
3
5
6TEST_CASE ("get_process_id") { CHECK (get_process_id () >= 1); }
7
8TEST_CASE ("get_env/set_env") {
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}
18
19TEST_CASE ("get_user_name") {
20 CHECK (N (get_user_name ()) >= 0);
21 // cout << get_user_name () << LF;
22}
23
24TEST_CASE ("get_stacktrace") {
25 CHECK (N (lolly::get_stacktrace (10)) >= 0);
26 cout << lolly::get_stacktrace (10) << LF;
27}
28
int N(array< T > a)
Get the length of the array.
Definition array.hpp:170
@ LF
Definition basic.hpp:287
The list class represents a linked list.
Definition list.hpp:48
#define TEST_MEMORY_LEAK_INIT
#define TEST_MEMORY_LEAK_ALL
string get_stacktrace(unsigned int max_frames)
TEST_CASE("test for operator+= and advance()")
string get_user_name()
Definition sys_utils.cpp:79
SN get_process_id()
void set_env(string var, string with)
Definition sys_utils.cpp:49
string get_env(string var)
Definition sys_utils.cpp:25
tm_ostream & cout