Lolly 1.4.27
Loading...
Searching...
No Matches
Functions
shared_lib_test.cpp File Reference
#include "a_lolly_test.hpp"
#include "lolly/system/shared_lib.hpp"
#include "sys_utils.hpp"
Include dependency graph for shared_lib_test.cpp:

Go to the source code of this file.

Functions

 TEST_CASE ("load_shared_library")
 

Function Documentation

◆ TEST_CASE()

TEST_CASE ( "load_shared_library" )

Definition at line 21 of file shared_lib_test.cpp.

21 {
22#ifndef OS_WASM
24 if (os_win ()) {
25 lib_path= url_pwd () * "example_dynamic_library.dll";
26 }
27 else if (os_macos ()) {
28 lib_path= url_pwd () * "libexample_dynamic_library.dylib";
29 }
30 else {
31 lib_path= url_pwd () * "libexample_dynamic_library.so";
32 }
33 shared_lib lib= load_shared_library ("example_dynamic_library", lib_path);
34 double (*func) (int)= lib->get_function<double, int> ("square_div_2");
35 double res = func (5);
36 CHECK_EQ (res, 12.5);
37#endif
38}
The list class represents a linked list.
Definition list.hpp:48
Definition url.hpp:37
bool os_macos()
bool os_win()
Definition sys_utils.cpp:94
url url_pwd()
Definition url.cpp:326