Unit Testing in C++

Started by
19 comments, last by Washu 12 years, 2 months ago

You can use /clr compiler switch to fix these errors.That force the compiler to generate mixed assemblies contain both managed and native parts, allow you to apply .net features in unmanaged code. turn off /clr:safe switch by going to project->properties->Configuration Properties->General, in configuration page look for "Common Language Runtime Support", select /clr option.
A common way test your code(native code) in managed C++ is to use P/Invoke.
but if ur project is not integrated with TFS, U should choice better test suite to accomplish ur work.
hope this info can help u.

No. The /clr flag WOULD NOT HELP.
/clr induces managed compilation which DOES NOT REPLICATE the unmanaged environment of normal C++. Hence your magical /clr unit tests would be about as useful as a dead dog.

Is this about IDE? The visual studio?

The fact it does not have File->New Unit Test? Which in Eclipse would generate a test stub?

Visual Studio has this, I even use it occasionally, when I'm using the visual studio integrated testing suite. Although typically I prefer nunit et. al. because they tend to be a bit better. Visual studio unit testing isn't really unit testing so much as it is "after the fact" testing.

This topic is nearly a year old. The OP is probably not still around.

Maybe. Who knows.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

This topic is closed to new replies.

Advertisement