[
https://issues.apache.org/jira/browse/ZOOKEEPER-1742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13793718#comment-13793718
]
Germán Blanco commented on ZOOKEEPER-1742:
------------------------------------------
I need a bit of help here.
I have tried using dlsym instead of the --wrap linker option, but I found an
error when doing it. It is most likely due to the corresponding shared library
not being loaded in memory when calling dlsym. I will need to look it up,
unless there is a different way to solve this ...
The dlsym method will not work for the functions that are not in shared
libraries (e.g. deliverWatchers), and for those I was thinking in using a new
macro and compiling a new version of the libraries for use only in test. In
that new version of the library, all the calls to functions that are now
wrapped will have "wrap_" appended to their name. The wrapper function in the
test code will have this name ("wrap_" appended) and call the original function.
Will that work for all functions? That means, also for those that are now
wrapped but are not part of the zookeeper library code (e.g. calloc).
If that works, then I would use the same method for all those wrapped
functions, and this method is portable to all platforms.
Can anybody please answer this question?
> "make check" doesn't work on macos
> ----------------------------------
>
> Key: ZOOKEEPER-1742
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1742
> Project: ZooKeeper
> Issue Type: Bug
> Reporter: Flavio Junqueira
> Assignee: Benjamin Reed
> Fix For: 3.4.6, 3.5.0
>
>
> There are two problems I have spotted when running "make check" with the C
> client. First, it complains that the sleep call is not defined in two test
> files: tests/ZooKeeperQuorumServer.cc and tests/TestReconfigServer.cc.
> Including unistd.h works. The second problem is with linker options. It
> complains that "--wrap" is not a valid. I'm not sure how to deal with this
> one yet, since I'm not sure why we are using it.
--
This message was sent by Atlassian JIRA
(v6.1#6144)