"C" Unit-Test Support on Visual Studio


Guy <guy.tal@...>
 

Hello,

The payload unit tests do not run on VS 2012, I have fixed this and produced a large patch with all "C" unit tests. I have prepared the patch against the 'master' (rev. 2.3.1 and not the 'next' branch) with unit-tests ported to Visual Studio 2005 format.

I've tested the unit tests to build on VS2005 against Google-tests 1.6.0, then I tested them to build in VS2012.

If any one has other versions of Visual Studio and wants to check it out with VS 2010, 2008 and 2005 that would be great.

The patch consists of changes to the source and few additional projects as described below:
  1. Added additional projects for each unit-test following the naming conventions in the make files.
  2. Added only necessary missing dll-exports for correct compilation of used libraries.
  3. Added missing functions to port.h/c for Windows (strndup)
  4. Replaced non-working traits (because of min/max macros) with equivalents from port.h, see example:
-    ret = aBridge->msgPayloadAddU8 (testPayload, NULL, ++fid, std::numeric_limits<mama_u8_t>::max ());
+      ret = aBridge->msgPayloadAddU8 (testPayload, NULL, ++fid, UINT8_MAX);
  1. Fixed issues related to Visual Studio 2012 (should apply to 2010) in the unit test projects. see preprocessor: _VARIADIC_MAX=10.
  2. Removed unnecessary warnings with _CRT_SECURE_NO_WARNINGS
  3. Changed the path for linking x64 build of gtest.lib. I found that building x64 version of gtest.lib by adding x64 configuration and then using VS default output directories a better way, which is expected to build easily with no extra work.
Regards,
Guy
Tick42



Join Openmama-dev@lists.openmama.org to automatically receive all group messages.