Improving Unit Testing for Visual C++

January 25th, 2011 Issam No comments

Visual Studio comes with an interesting tool for unit testing as described in this post, but this solution had the following disadvantages due to using C++\CLI:

  • Intellisense not supported for C++\CLI.
  • Assert is designed for .Net languages , and using it for native C++ induce using some workarounds like:Assert for string,Assert::IsNullPointer.
  • nullptr exist both in C++0x and CLI and concerning test for C++0x code we have to use __nullptr instead.
  • Many developers dont understand why they have to use C++\CLI to test native C++.

Read more…

Categories: C++ Tags:

Which string type to use for C++?

January 12th, 2011 Issam No comments

If we ask C++ developers which type they use for string, we can have many answers like:

char*, std::string , CString(MFC), CString(ATL) , QString (Qt) , wxString(wxWidgets), BSTR or another class from a third party framework.

Unfortunately having all these types add more complexity to the C++ langage. And mixing some of them increases the risk to have a code base difficult to maintain.

Read more…

Categories: C++ Tags: