Re: "C" Unit-Test Support on Visual Studio

Guy <guy.tal@...>

Hi Damian,

I've prepared here a revised version of the last experimental patch to support MAMA C Unit-Tests in Visual Studio.
I removed in the last version both implementation and use of strndup, other than that it should almost be the same as last version.

This should work against the master branch.

I'm working now on a patch that should work correctly on 'next' branch (including git format etc.)

This mail is a follow up for the bug #125 in bugzilla, basically for other people to experiment with that too.


On 11/09/2014 16:06, Guy wrote:

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.

Openmama-dev mailing list

Join to automatically receive all group messages.