I am writing a distributed project using a server-client model which extensively use send and recv sockets functions. Since the behavior of those functions depends of the other side (e.g. if it is in the server side it needs the client side to work correctly ), I need some way to test each side independently of the other side. So far, I found that mocking functions may be the right approach to follow.
Also since I am using unittest++ in that project, I found that AMOP is the mocking function framework which fits best. However after read the documentation of AMOP library I did not get a clear idea how it works.
In short, what I need is to change the sendto function to a mock function in the unit test file, so that whenever the server calles internally sendto, it will call my mock function.