Hi.. I'm currently trying to use a certain SDK that has me loading functions off a DLL that a vendor provides.. I have to pass arguments to these functions and the DLL does all the work..
Now, the DLL is supposed to be communicating with another device, while I just wait for the results. However, I don't have this device, so how do I set up a mock interface to emulate the device?
To be clear, here's an example:
myfuncpointer.Open(someparam,anotherparam,...);
Now, because I don't have the device, the DLL can't actually perform the above function; it fails. How do I set up testing so that the DLL talks to a class that I designed rather than the device? Is there any way to redirect the DLL's call?
How do I make a DummyDevice class to do this?
Thanks..
P.S. If anything is not clear, please don't be too quick to downvote.. Comment as to what I need to explain and I'll try to clear it up.. Thanks.
EDIT: What I DO have, however, is a spec sheet with all of the data structures used and the expected/legal values that it has to contain. So for example, if I call a function:
myfuncpointer.getinfo(param,otherparam);
where one of the params is a data structure that the DLL fills up with info (say, if an option is enabled) after querying the device.. I can do this
param.option = true;
after it has finished the getinfo call.
Is this a good way to test the code? It seems very very dangerous to trick this DLL into thinking all the wrong things and seems to be really really hard to scale even just a bit..