简体   繁体   中英

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

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://docs.microsoft.com/en-us/visualstudio/test/writing-unit-tests-for-c-cpp . Edit: I am assuming you have access to DLL code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM