vbNewbie
vbNewbie

Reputation: 3345

test a C++ dll function

I am trying to test a dll that was created in C++, specifically to test certain functions. A few search results gave the solution as testing in visual studio by creating a simple unit test and referencing the dll as a project. But the solution is not very clear to me and there is no way to add the dll to the unit test project, as the only options are projects, solution, shared projects. I don't even see the browse button.

Does anyone have a solution or could you explain this solution provided here? I just want to be able to call the dll function, from a C++ class or project to test the input & output.

test dll

Upvotes: 0

Views: 2524

Answers (1)

ZoomIn
ZoomIn

Reputation: 1321

It is pretty straight forward actually. In the DLL project you can create a native Unit test project and write test methods. Here is the link to clear steps with screenshots - https://learn.microsoft.com/en-us/visualstudio/test/writing-unit-tests-for-c-cpp. Edit: I am assuming you have access to DLL code.

Upvotes: 2

Related Questions