Are there any Regression Tests coded in C/C++ to test all the functionality of CString (ATL/MFC)?

StackOverflow https://stackoverflow.com/questions/1918360

  •  20-09-2019
  •  | 
  •  

Question

I am trying to do a comparison of CString from ATL/MFC to a custom CString implementation and I want to make sure that all the functionality in the custom implementation matches that of the ATL/MFC implementation.

The reason we have a custom CString implementation is so that we can use it on *nix and Windows platforms. The interface is the same, but the implementation is different so when we port our Windows code to use the SDK we are writing we don't have to change ALL the names ... we will only have to work out the differences between the two implementations.

Any help on this would be greatly appreciated. Thanks!

Was it helpful?

Solution

Personally I cannot think of any. However if I were doing it I would encode all the use cases I have for it and make sure I owned a test to cover it.

Also on windows do you delegate to the supplied implementaton or your own? If you delegated you could find your tests more useful as they could highlight differences.

Good luck,

OTHER TIPS

CString provides a whole host of template and operator overloads which it inherets from the ATLCStringT. To be able to use ATL algorithms or structures you would need to implement everything(CMAP). If you however use it as a basic char* wrapper you should be fine.

Note that CString is more optimal when compiled under Visual Studio than default std::string.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top