commit 74cd857ce792cfbd3bcc490d2c5a3350d500d21e
Author: Ian Bell <IBell@...>
Date: Thu May 17 21:48:53 2012 +0100
[mama] Added a unittest command line arg to test different payloads
Signed-off-by: Ian Bell <IBell@...>
diff --git a/mama/c_cpp/src/gunittest/Makefile.am b/mama/c_cpp/src/gunittest/Makefile.am
index 3a09645..b51c0af 100644
--- a/mama/c_cpp/src/gunittest/Makefile.am
+++ b/mama/c_cpp/src/gunittest/Makefile.am
@@ -24,5 +24,3 @@ VPATH = @srcdir@
SUBDIRS = c cpp
-CPPFLAGS += -DWITH_UNIT_TESTS
-CFLAGS += -DWITH_UNIT_TESTS
diff --git a/mama/c_cpp/src/gunittest/c/MainUnitTestC.cpp b/mama/c_cpp/src/gunittest/c/MainUnitTestC.cpp
index 9b0ea7d..9343e86 100644
--- a/mama/c_cpp/src/gunittest/c/MainUnitTestC.cpp
+++ b/mama/c_cpp/src/gunittest/c/MainUnitTestC.cpp
@@ -38,6 +38,7 @@ static string version ("APPNAMESTR: Version " VERSIONSTR
static const char* gMiddleware = "wmw";
+static const char* gPayload = "wmsg";
const char* getMiddleware (void)
@@ -45,6 +46,11 @@ const char* getMiddleware (void)
return gMiddleware;
}
+const char* getPayload (void)
+{
+ return gPayload;
+}
+
static void parseCommandLine (int argc, char** argv)
{
int i = 1;
@@ -57,6 +63,11 @@ static void parseCommandLine (int argc, char** argv)
gMiddleware = argv[i+1];
i += 2;
}
+ else if (strcmp ("-p", argv[i]) == 0)
+ {
+ gPayload = argv[i+1];
+ i += 2;
+ }
else
{
//unknown arg
diff --git a/mama/c_cpp/src/gunittest/c/MainUnitTestC.h b/mama/c_cpp/src/gunittest/c/MainUnitTestC.h
index 595521b..947cc90 100644
--- a/mama/c_cpp/src/gunittest/c/MainUnitTestC.h
+++ b/mama/c_cpp/src/gunittest/c/MainUnitTestC.h
@@ -25,4 +25,5 @@
const char* getMiddleware (void);
+const char* getPayload (void);
#endif /* MAINUNITTESTC_H_ */