Skip to content

Commit

Permalink
Cleanup for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
hariharan-devarajan committed Apr 22, 2024
1 parent 1d510f2 commit 4c469e4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ tags
*.core
.cache
.idea
.vscode
.vscode
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ add_subdirectory(wrap_main)
#add_subdirectory(multi_agent_dlopen)
add_subdirectory(symver)
add_subdirectory(function_ptr)
add_subdirectory(dispatcher)
add_subdirectory(dispatcher)
2 changes: 1 addition & 1 deletion test/dispatcher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ add_executable(test_dispatcher main.c)
target_link_libraries(test_dispatcher gotcha dispatcher)
gotcha_add_test(dispatcher_test test_dispatcher)
set_property(TEST dispatcher_test APPEND PROPERTY ENVIRONMENT "GOTCHA_DEBUG=3")
set_property(TEST dispatcher_test APPEND PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}")
set_property(TEST dispatcher_test APPEND PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}")
10 changes: 4 additions & 6 deletions test/dispatcher/libdispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#define _GNU_SOURCE
#include <assert.h>
#include <dlfcn.h>
#include <math.h>
#include <pthread.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

int foo(void);
int bar(void);
Expand All @@ -36,8 +31,11 @@ void dispatch_init(void) {
fprintf(stderr, "Ed dispatch_init()\n");

impl_lib = dlopen("libimpl.so", RTLD_NOW);
assert(impl_lib);
impl_foo = dlsym(impl_lib, "foo");
assert(impl_foo);
impl_bar = dlsym(impl_lib, "bar");
assert(impl_bar);

int ret = impl_bar();

Expand Down
6 changes: 0 additions & 6 deletions test/dispatcher/libimpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#define _GNU_SOURCE
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

int foo(void) {
fprintf(stderr, "Ei foo()\n");
Expand Down
8 changes: 1 addition & 7 deletions test/dispatcher/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#define _GNU_SOURCE
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <gotcha/gotcha.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

int foo(void);
int bar(void);
#include <gotcha/gotcha.h>

static gotcha_wrappee_handle_t handle_foo;
static gotcha_wrappee_handle_t handle_bar;
Expand Down

0 comments on commit 4c469e4

Please sign in to comment.