You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by ab...@apache.org on 2013/10/02 11:01:23 UTC

svn commit: r1528380 [5/5] - in /incubator/celix/trunk: ./ cmake/ cmake/cmock/ cmake/cmock/config/ cmake/cmock/lib/ cmake/cmock/src/ cmake/cpputest/ cmake/cpputest/include/ cmake/cpputest/include/CppUTest/ cmake/cpputest/include/CppUTestExt/ cmake/cppu...

Added: incubator/celix/trunk/cmake/unity/src/unity_internals.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/unity/src/unity_internals.h?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/cmake/unity/src/unity_internals.h (added)
+++ incubator/celix/trunk/cmake/unity/src/unity_internals.h Wed Oct  2 09:01:20 2013
@@ -0,0 +1,414 @@
+/* ==========================================
+    Unity Project - A Test Framework for C
+    Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
+    [Released under MIT License. Please refer to license.txt for details]
+========================================== */
+
+#ifndef UNITY_INTERNALS_H
+#define UNITY_INTERNALS_H
+
+#include <stdio.h>
+#include <setjmp.h>
+
+//-------------------------------------------------------
+// Int Support
+//-------------------------------------------------------
+
+#ifndef UNITY_INT_WIDTH
+#define UNITY_INT_WIDTH (32)
+#endif
+
+#ifndef UNITY_LONG_WIDTH
+#define UNITY_LONG_WIDTH (32)
+#endif
+
+#if (UNITY_INT_WIDTH == 32)
+    typedef unsigned char   _UU8;
+    typedef unsigned short  _UU16;
+    typedef unsigned int    _UU32;
+    typedef signed char     _US8;
+    typedef signed short    _US16;
+    typedef signed int      _US32;
+#elif (UNITY_INT_WIDTH == 16)
+    typedef unsigned char   _UU8;
+    typedef unsigned int    _UU16;
+    typedef unsigned long   _UU32;
+    typedef signed char     _US8;
+    typedef signed int      _US16;
+    typedef signed long     _US32;
+#else
+    #error Invalid UNITY_INT_WIDTH specified! (16 or 32 are supported)
+#endif
+
+//-------------------------------------------------------
+// 64-bit Support
+//-------------------------------------------------------
+
+#ifndef UNITY_SUPPORT_64
+
+//No 64-bit Support
+typedef _UU32 _U_UINT;
+typedef _US32 _U_SINT;
+
+#else
+
+//64-bit Support
+#if (UNITY_LONG_WIDTH == 32)
+    typedef unsigned long long _UU64;
+    typedef signed long long   _US64;
+#elif (UNITY_LONG_WIDTH == 64)
+    typedef unsigned long      _UU64;
+    typedef signed long        _US64;
+#else
+    #error Invalid UNITY_LONG_WIDTH specified! (32 or 64 are supported)
+#endif
+typedef _UU64 _U_UINT;
+typedef _US64 _U_SINT;
+
+#endif
+
+//-------------------------------------------------------
+// Pointer Support
+//-------------------------------------------------------
+
+#ifndef UNITY_POINTER_WIDTH
+#define UNITY_POINTER_WIDTH (32)
+#endif
+
+#if (UNITY_POINTER_WIDTH == 32)
+    typedef _UU32 _UP;
+#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX32
+#elif (UNITY_POINTER_WIDTH == 64)
+#ifndef UNITY_SUPPORT_64
+#error "You've Specified 64-bit pointers without enabling 64-bit Support. Define UNITY_SUPPORT_64"
+#endif
+    typedef _UU64 _UP;
+#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX64
+#elif (UNITY_POINTER_WIDTH == 16)
+    typedef _UU16 _UP;
+#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX16
+#else
+    #error Invalid UNITY_POINTER_WIDTH specified! (16, 32 or 64 are supported)
+#endif
+
+//-------------------------------------------------------
+// Float Support
+//-------------------------------------------------------
+
+#ifdef UNITY_EXCLUDE_FLOAT 
+
+//No Floating Point Support
+#undef UNITY_FLOAT_PRECISION
+#undef UNITY_FLOAT_TYPE
+#undef UNITY_FLOAT_VERBOSE
+
+#else
+
+//Floating Point Support
+#ifndef UNITY_FLOAT_PRECISION
+#define UNITY_FLOAT_PRECISION (0.00001f)
+#endif
+#ifndef UNITY_FLOAT_TYPE
+#define UNITY_FLOAT_TYPE float
+#endif
+typedef UNITY_FLOAT_TYPE _UF;
+    
+#endif
+
+//-------------------------------------------------------
+// Double Float Support
+//-------------------------------------------------------
+
+//unlike FLOAT, we DON'T include by default
+#ifndef UNITY_EXCLUDE_DOUBLE
+#ifndef UNITY_INCLUDE_DOUBLE
+#define UNITY_EXCLUDE_DOUBLE
+#endif
+#endif
+
+#ifdef UNITY_EXCLUDE_DOUBLE 
+
+//No Floating Point Support
+#undef UNITY_DOUBLE_PRECISION
+#undef UNITY_DOUBLE_TYPE
+#undef UNITY_DOUBLE_VERBOSE
+
+#else
+
+//Floating Point Support
+#ifndef UNITY_DOUBLE_PRECISION
+#define UNITY_DOUBLE_PRECISION (1e-12f) 
+#endif
+#ifndef UNITY_DOUBLE_TYPE
+#define UNITY_DOUBLE_TYPE double
+#endif
+typedef UNITY_DOUBLE_TYPE _UD;
+    
+#endif
+
+//-------------------------------------------------------
+// Output Method
+//-------------------------------------------------------
+
+#ifndef UNITY_OUTPUT_CHAR
+//Default to using putchar, which is defined in stdio.h above
+#define UNITY_OUTPUT_CHAR(a) putchar(a)
+#else
+//If defined as something else, make sure we declare it here so it's ready for use
+extern int UNITY_OUTPUT_CHAR(int);
+#endif
+
+//-------------------------------------------------------
+// Footprint
+//-------------------------------------------------------
+
+#ifndef UNITY_LINE_TYPE
+#define UNITY_LINE_TYPE unsigned short
+#endif
+
+#ifndef UNITY_COUNTER_TYPE
+#define UNITY_COUNTER_TYPE unsigned short
+#endif
+
+//-------------------------------------------------------
+// Internal Structs Needed
+//-------------------------------------------------------
+
+typedef void (*UnityTestFunction)(void);
+
+#define UNITY_DISPLAY_RANGE_INT  (0x10)
+#define UNITY_DISPLAY_RANGE_UINT (0x20)
+#define UNITY_DISPLAY_RANGE_HEX  (0x40)
+#define UNITY_DISPLAY_RANGE_AUTO (0x80)
+
+typedef enum
+{
+    UNITY_DISPLAY_STYLE_INT      = 4 + UNITY_DISPLAY_RANGE_INT + UNITY_DISPLAY_RANGE_AUTO,
+    UNITY_DISPLAY_STYLE_INT8     = 1 + UNITY_DISPLAY_RANGE_INT,
+    UNITY_DISPLAY_STYLE_INT16    = 2 + UNITY_DISPLAY_RANGE_INT,
+    UNITY_DISPLAY_STYLE_INT32    = 4 + UNITY_DISPLAY_RANGE_INT,
+#ifdef UNITY_SUPPORT_64
+    UNITY_DISPLAY_STYLE_INT64    = 8 + UNITY_DISPLAY_RANGE_INT,
+#endif
+    UNITY_DISPLAY_STYLE_UINT     = 4 + UNITY_DISPLAY_RANGE_UINT + UNITY_DISPLAY_RANGE_AUTO,
+    UNITY_DISPLAY_STYLE_UINT8    = 1 + UNITY_DISPLAY_RANGE_UINT,
+    UNITY_DISPLAY_STYLE_UINT16   = 2 + UNITY_DISPLAY_RANGE_UINT,
+    UNITY_DISPLAY_STYLE_UINT32   = 4 + UNITY_DISPLAY_RANGE_UINT,
+#ifdef UNITY_SUPPORT_64
+    UNITY_DISPLAY_STYLE_UINT64   = 8 + UNITY_DISPLAY_RANGE_UINT,
+#endif
+    UNITY_DISPLAY_STYLE_HEX8     = 1 + UNITY_DISPLAY_RANGE_HEX,
+    UNITY_DISPLAY_STYLE_HEX16    = 2 + UNITY_DISPLAY_RANGE_HEX,
+    UNITY_DISPLAY_STYLE_HEX32    = 4 + UNITY_DISPLAY_RANGE_HEX,
+#ifdef UNITY_SUPPORT_64
+    UNITY_DISPLAY_STYLE_HEX64    = 8 + UNITY_DISPLAY_RANGE_HEX,
+#endif
+} UNITY_DISPLAY_STYLE_T;
+
+struct _Unity
+{
+    const char* TestFile;
+    const char* CurrentTestName;
+    _UU32 CurrentTestLineNumber;
+    UNITY_COUNTER_TYPE NumberOfTests;
+    UNITY_COUNTER_TYPE TestFailures;
+    UNITY_COUNTER_TYPE TestIgnores;
+    UNITY_COUNTER_TYPE CurrentTestFailed;
+    UNITY_COUNTER_TYPE CurrentTestIgnored;
+    jmp_buf AbortFrame;
+};
+
+extern struct _Unity Unity;
+
+//-------------------------------------------------------
+// Test Suite Management
+//-------------------------------------------------------
+
+void UnityBegin(void);
+int  UnityEnd(void);
+void UnityConcludeTest(void);
+void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum);
+
+//-------------------------------------------------------
+// Test Output
+//-------------------------------------------------------
+
+void UnityPrint(const char* string);
+void UnityPrintMask(const _U_UINT mask, const _U_UINT number);
+void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T style);
+void UnityPrintNumber(const _U_SINT number);
+void UnityPrintNumberUnsigned(const _U_UINT number);
+void UnityPrintNumberHex(const _U_UINT number, const char nibbles);
+
+#ifdef UNITY_FLOAT_VERBOSE
+void UnityPrintFloat(const _UF number);
+#endif
+
+//-------------------------------------------------------
+// Test Assertion Fuctions
+//-------------------------------------------------------
+//  Use the macros below this section instead of calling
+//  these directly. The macros have a consistent naming
+//  convention and will pull in file and line information
+//  for you.
+
+void UnityAssertEqualNumber(const _U_SINT expected,
+                            const _U_SINT actual,
+                            const char* msg,
+                            const UNITY_LINE_TYPE lineNumber,
+                            const UNITY_DISPLAY_STYLE_T style);
+
+void UnityAssertEqualIntArray(const _U_SINT* expected,
+                              const _U_SINT* actual,
+                              const _UU32 num_elements,
+                              const char* msg,
+                              const UNITY_LINE_TYPE lineNumber,
+                              const UNITY_DISPLAY_STYLE_T style);
+
+void UnityAssertBits(const _U_SINT mask,
+                     const _U_SINT expected,
+                     const _U_SINT actual,
+                     const char* msg,
+                     const UNITY_LINE_TYPE lineNumber);
+
+void UnityAssertEqualString(const char* expected,
+                            const char* actual,
+                            const char* msg,
+                            const UNITY_LINE_TYPE lineNumber);
+
+void UnityAssertEqualStringArray( const char** expected,
+                                  const char** actual,
+                                  const _UU32 num_elements,
+                                  const char* msg,
+                                  const UNITY_LINE_TYPE lineNumber);
+
+void UnityAssertEqualMemory( const void* expected,
+                             const void* actual,
+                             const _UU32 length,
+                             const _UU32 num_elements,
+                             const char* msg,
+                             const UNITY_LINE_TYPE lineNumber);
+
+void UnityAssertNumbersWithin(const _U_SINT delta,
+                              const _U_SINT expected,
+                              const _U_SINT actual,
+                              const char* msg,
+                              const UNITY_LINE_TYPE lineNumber,
+                              const UNITY_DISPLAY_STYLE_T style);
+
+void UnityFail(const char* message, const UNITY_LINE_TYPE line);
+
+void UnityIgnore(const char* message, const UNITY_LINE_TYPE line);
+
+#ifndef UNITY_EXCLUDE_FLOAT
+void UnityAssertFloatsWithin(const _UF delta,
+                             const _UF expected,
+                             const _UF actual,
+                             const char* msg,
+                             const UNITY_LINE_TYPE lineNumber);
+
+void UnityAssertEqualFloatArray(const _UF* expected,
+                                const _UF* actual,
+                                const _UU32 num_elements,
+                                const char* msg,
+                                const UNITY_LINE_TYPE lineNumber);
+#endif
+
+#ifndef UNITY_EXCLUDE_DOUBLE
+void UnityAssertDoublesWithin(const _UD delta,
+                              const _UD expected,
+                              const _UD actual,
+                              const char* msg,
+                              const UNITY_LINE_TYPE lineNumber);
+
+void UnityAssertEqualDoubleArray(const _UD* expected,
+                                 const _UD* actual,
+                                 const _UU32 num_elements,
+                                 const char* msg,
+                                 const UNITY_LINE_TYPE lineNumber);
+#endif
+
+//-------------------------------------------------------
+// Basic Fail and Ignore
+//-------------------------------------------------------
+
+#define UNITY_TEST_FAIL(line, message)   UnityFail(   (message), (UNITY_LINE_TYPE)line);
+#define UNITY_TEST_IGNORE(line, message) UnityIgnore( (message), (UNITY_LINE_TYPE)line);
+
+//-------------------------------------------------------
+// Test Asserts
+//-------------------------------------------------------
+
+#define UNITY_TEST_ASSERT(condition, line, message)                                              if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
+#define UNITY_TEST_ASSERT_NULL(pointer, line, message)                                           UNITY_TEST_ASSERT(((pointer) == NULL),  (UNITY_LINE_TYPE)line, message)
+#define UNITY_TEST_ASSERT_NOT_NULL(pointer, line, message)                                       UNITY_TEST_ASSERT(((pointer) != NULL),  (UNITY_LINE_TYPE)line, message)
+
+#define UNITY_TEST_ASSERT_EQUAL_INT(expected, actual, line, message)                             UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT)
+#define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message)                            UnityAssertEqualNumber((_U_SINT)(_US8 )(expected), (_U_SINT)(_US8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT)
+#define UNITY_TEST_ASSERT_EQUAL_INT16(expected, actual, line, message)                           UnityAssertEqualNumber((_U_SINT)(_US16)(expected), (_U_SINT)(_US16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT)
+#define UNITY_TEST_ASSERT_EQUAL_INT32(expected, actual, line, message)                           UnityAssertEqualNumber((_U_SINT)(_US32)(expected), (_U_SINT)(_US32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT)
+#define UNITY_TEST_ASSERT_EQUAL_UINT(expected, actual, line, message)                            UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT)
+#define UNITY_TEST_ASSERT_EQUAL_UINT8(expected, actual, line, message)                           UnityAssertEqualNumber((_U_SINT)(_US8 )(expected), (_U_SINT)(_US8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT)
+#define UNITY_TEST_ASSERT_EQUAL_UINT16(expected, actual, line, message)                          UnityAssertEqualNumber((_U_SINT)(_US16)(expected), (_U_SINT)(_US16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT)
+#define UNITY_TEST_ASSERT_EQUAL_UINT32(expected, actual, line, message)                          UnityAssertEqualNumber((_U_SINT)(_US32)(expected), (_U_SINT)(_US32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT)
+#define UNITY_TEST_ASSERT_EQUAL_HEX8(expected, actual, line, message)                            UnityAssertEqualNumber((_U_SINT)(_US8 )(expected), (_U_SINT)(_US8 )(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX8)
+#define UNITY_TEST_ASSERT_EQUAL_HEX16(expected, actual, line, message)                           UnityAssertEqualNumber((_U_SINT)(_US16)(expected), (_U_SINT)(_US16)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX16)
+#define UNITY_TEST_ASSERT_EQUAL_HEX32(expected, actual, line, message)                           UnityAssertEqualNumber((_U_SINT)(_US32)(expected), (_U_SINT)(_US32)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX32)
+#define UNITY_TEST_ASSERT_BITS(mask, expected, actual, line, message)                            UnityAssertBits((_U_SINT)(mask), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line)
+
+#define UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message)                     UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT)
+#define UNITY_TEST_ASSERT_UINT_WITHIN(delta, expected, actual, line, message)                    UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT)
+#define UNITY_TEST_ASSERT_HEX8_WITHIN(delta, expected, actual, line, message)                    UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU8 )(delta), (_U_SINT)(_U_UINT)(_UU8 )(expected), (_U_SINT)(_U_UINT)(_UU8 )(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX8)
+#define UNITY_TEST_ASSERT_HEX16_WITHIN(delta, expected, actual, line, message)                   UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU16)(delta), (_U_SINT)(_U_UINT)(_UU16)(expected), (_U_SINT)(_U_UINT)(_UU16)(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX16)
+#define UNITY_TEST_ASSERT_HEX32_WITHIN(delta, expected, actual, line, message)                   UnityAssertNumbersWithin((_U_SINT)(_U_UINT)(_UU32)(delta), (_U_SINT)(_U_UINT)(_UU32)(expected), (_U_SINT)(_U_UINT)(_UU32)(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX32)
+
+#define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message)                             UnityAssertEqualNumber((_U_SINT)(_UP)(expected), (_U_SINT)(_UP)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_POINTER)
+#define UNITY_TEST_ASSERT_EQUAL_STRING(expected, actual, line, message)                          UnityAssertEqualString((const char*)(expected), (const char*)(actual), (message), (UNITY_LINE_TYPE)line)
+#define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message)                     UnityAssertEqualMemory((void*)(expected), (void*)(actual), (_UU32)(len), 1, (message), (UNITY_LINE_TYPE)line)
+
+#define UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements, line, message)         UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT)
+#define UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements, line, message)        UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT8)
+#define UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements, line, message)       UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT16)
+#define UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements, line, message)       UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT32)
+#define UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements, line, message)        UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT)
+#define UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements, line, message)       UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT8)
+#define UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements, line, message)      UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT16)
+#define UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements, line, message)      UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT32)
+#define UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements, line, message)        UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX8)
+#define UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements, line, message)       UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX16)
+#define UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements, line, message)       UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX32)
+#define UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements, line, message)         UnityAssertEqualIntArray((const _U_SINT*)(_UP*)(expected), (const _U_SINT*)(_UP*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_POINTER)
+#define UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements, line, message)      UnityAssertEqualStringArray((const char**)(expected), (const char**)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line)
+#define UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((void*)(expected), (void*)(actual), (_UU32)(len), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line)
+
+#ifdef UNITY_SUPPORT_64
+#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message)                           UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT64)
+#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message)                          UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT64)
+#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message)                           UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX64)
+#define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message)       UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT64)
+#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message)      UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT64)
+#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message)       UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX64)
+#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message)                   UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX64)
+#endif
+
+#ifdef UNITY_EXCLUDE_FLOAT
+#define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message)                   UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, "Unity Floating Point Disabled")
+#define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message)                           UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, "Unity Floating Point Disabled")
+#define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message)       UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, "Unity Floating Point Disabled")
+#else
+#define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message)                   UnityAssertFloatsWithin((_UF)(delta), (_UF)(expected), (_UF)(actual), (message), (UNITY_LINE_TYPE)line)
+#define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message)                           UNITY_TEST_ASSERT_FLOAT_WITHIN((_UF)(expected) * (_UF)UNITY_FLOAT_PRECISION, (_UF)expected, (_UF)actual, (UNITY_LINE_TYPE)line, message)
+#define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message)       UnityAssertEqualFloatArray((_UF*)(expected), (_UF*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line)
+#endif
+
+#ifdef UNITY_EXCLUDE_DOUBLE
+#define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, message)                  UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, "Unity Double Precision Disabled")
+#define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message)                          UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, "Unity Double Precision Disabled")
+#define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message)      UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, "Unity Double Precision Disabled")
+#else
+#define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, message)                  UnityAssertDoublesWithin((_UD)(delta), (_UD)(expected), (_UD)(actual), (message), (UNITY_LINE_TYPE)line)
+#define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message)                          UNITY_TEST_ASSERT_DOUBLE_WITHIN((_UF)(expected) * (_UD)UNITY_DOUBLE_PRECISION, (_UD)expected, (_UD)actual, (UNITY_LINE_TYPE)line, message)
+#define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message)      UnityAssertEqualDoubleArray((_UD*)(expected), (_UD*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line)
+#endif
+
+#endif

Added: incubator/celix/trunk/cmake/unity/test_file_filter.rb
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/unity/test_file_filter.rb?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/cmake/unity/test_file_filter.rb (added)
+++ incubator/celix/trunk/cmake/unity/test_file_filter.rb Wed Oct  2 09:01:20 2013
@@ -0,0 +1,23 @@
+# ==========================================
+#   Unity Project - A Test Framework for C
+#   Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
+#   [Released under MIT License. Please refer to license.txt for details]
+# ========================================== 
+
+require'yaml'
+
+module RakefileHelpers
+  class TestFileFilter
+    def initialize(all_files = false)
+      @all_files = all_files
+      if not @all_files == true
+        if File.exist?('test_file_filter.yml')
+          filters = YAML.load_file( 'test_file_filter.yml' )
+          @all_files, @only_files, @exclude_files = 
+            filters[:all_files], filters[:only_files], filters[:exclude_files] 
+        end
+      end
+    end		
+    attr_accessor :all_files, :only_files, :exclude_files
+  end
+end

Added: incubator/celix/trunk/cmake/unity/unity_test_summary.rb
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/unity/unity_test_summary.rb?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/cmake/unity/unity_test_summary.rb (added)
+++ incubator/celix/trunk/cmake/unity/unity_test_summary.rb Wed Oct  2 09:01:20 2013
@@ -0,0 +1,139 @@
+# ==========================================
+#   Unity Project - A Test Framework for C
+#   Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
+#   [Released under MIT License. Please refer to license.txt for details]
+# ========================================== 
+
+#!/usr/bin/ruby
+#
+# unity_test_summary.rb
+#
+require 'fileutils'
+require 'set'
+
+class UnityTestSummary
+  include FileUtils::Verbose
+
+  attr_reader :report, :total_tests, :failures, :ignored
+  
+  def initialize
+    @report = ''
+    @total_tests = 0
+    @failures = 0
+    @ignored = 0
+  end
+  
+  def run
+    # Clean up result file names
+    results = @targets.map {|target| target.gsub(/\\/,'/')}
+    
+    # Dig through each result file, looking for details on pass/fail:   
+    failure_output = []
+    ignore_output = []
+    
+    results.each do |result_file|
+      lines = File.readlines(result_file).map { |line| line.chomp }
+      if lines.length == 0
+        raise "Empty test result file: #{result_file}"
+      else
+        output = get_details(result_file, lines)
+        failure_output << output[:failures] unless output[:failures].empty?
+        ignore_output  << output[:ignores]  unless output[:ignores].empty?
+        tests,failures,ignored = parse_test_summary(lines)
+        @total_tests += tests
+        @failures += failures
+        @ignored += ignored
+      end
+    end
+    
+    if @ignored > 0
+      @report += "\n"
+      @report += "--------------------------\n"
+      @report += "UNITY IGNORED TEST SUMMARY\n"
+      @report += "--------------------------\n"
+      @report += ignore_output.flatten.join("\n")
+    end
+    
+    if @failures > 0
+      @report += "\n"
+      @report += "--------------------------\n"
+      @report += "UNITY FAILED TEST SUMMARY\n"
+      @report += "--------------------------\n"
+      @report += failure_output.flatten.join("\n")
+    end
+  
+    @report += "\n"
+    @report += "--------------------------\n"
+    @report += "OVERALL UNITY TEST SUMMARY\n"
+    @report += "--------------------------\n"
+    @report += "#{@total_tests} TOTAL TESTS #{@failures} TOTAL FAILURES #{@ignored} IGNORED\n"
+    @report += "\n"
+  end
+  
+  def set_targets(target_array)
+    @targets = target_array
+  end
+  
+  def set_root_path(path)
+    @root = path
+  end
+
+  def usage(err_msg=nil)
+    puts "\nERROR: "
+    puts err_msg if err_msg
+    puts "\nUsage: unity_test_summary.rb result_file_directoy/ root_path/"
+    puts "     result_file_directory - The location of your relults files." 
+    puts "                             Defaults to current directory if not specified."
+    puts "                             Should end in / if specified."
+    puts "     root_path - Helpful for producing more verbose output if using relative paths."
+    exit 1
+  end
+  
+  protected
+
+  def get_details(result_file, lines)
+    results = { :failures => [], :ignores => [], :successes => [] }
+    lines.each do |line|
+      src_file,src_line,test_name,status,msg = line.split(/:/)
+      line_out = ((@root and (@root != 0)) ? "#{@root}#{line}" : line ).gsub(/\//, "\\")
+      case(status)
+        when 'IGNORE' then results[:ignores]   << line_out
+        when 'FAIL'   then results[:failures]  << line_out
+        when 'PASS'   then results[:successes] << line_out
+      end
+    end
+    return results
+  end
+  
+  def parse_test_summary(summary)
+    if summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ }
+      [$1.to_i,$2.to_i,$3.to_i]
+    else
+      raise "Couldn't parse test results: #{summary}"
+    end
+  end
+
+  def here; File.expand_path(File.dirname(__FILE__)); end
+  
+end
+
+if $0 == __FILE__
+  uts = UnityTestSummary.new
+  begin
+    #look in the specified or current directory for result files
+    ARGV[0] ||= './'
+    targets = "#{ARGV[0].gsub(/\\/, '/')}*.test*"
+    results = Dir[targets]
+    raise "No *.testpass or *.testfail files found in '#{targets}'" if results.empty?
+    uts.set_targets(results)
+    
+    #set the root path
+    ARGV[1] ||= File.expand_path(File.dirname(__FILE__)) + '/'
+    uts.set_root_path(ARGV[1])
+    
+    #run the summarizer
+    puts uts.run
+  rescue Exception => e
+    uts.usage e.message
+  end
+end

Added: incubator/celix/trunk/examples/component_testing/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/CMakeLists.txt?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/CMakeLists.txt (added)
+++ incubator/celix/trunk/examples/component_testing/CMakeLists.txt Wed Oct  2 09:01:20 2013
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+add_subdirectory(server)
+add_subdirectory(client)
+
+deploy(component_testing BUNDLES shell shell_tui log_service server client)
\ No newline at end of file

Added: incubator/celix/trunk/examples/component_testing/client/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/client/CMakeLists.txt?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/client/CMakeLists.txt (added)
+++ incubator/celix/trunk/examples/component_testing/client/CMakeLists.txt Wed Oct  2 09:01:20 2013
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+bundle(client SOURCES private/src/client_activator private/src/client_impl)
+include_directories("${PROJECT_SOURCE_DIR}/celix")
+include_directories("private/include")
+include_directories("public/include")
+include_directories("../server/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+target_link_libraries(client framework)
+
+include_directories("${PROJECT_SOURCE_DIR}/celix")
+include_directories(${PROJECT_SOURCE_DIR}/cmake/cpputest/include)
+link_directories(${PROJECT_SOURCE_DIR}/cmake/cpputest/lib)
+add_executable(client_test private/test/client_test private/src/client_impl)
+target_link_libraries(client_test CppUTest CppUTestExt framework)
+run_cppu_test(client_test)
\ No newline at end of file

Added: incubator/celix/trunk/examples/component_testing/client/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/client/META-INF/MANIFEST.MF?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/client/META-INF/MANIFEST.MF (added)
+++ incubator/celix/trunk/examples/component_testing/client/META-INF/MANIFEST.MF Wed Oct  2 09:01:20 2013
@@ -0,0 +1,4 @@
+Bundle-SymbolicName: client
+Bundle-Version: 1.0.0
+library: client
+Import-Service: server

Added: incubator/celix/trunk/examples/component_testing/client/private/include/client_impl.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/client/private/include/client_impl.h?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/client/private/include/client_impl.h (added)
+++ incubator/celix/trunk/examples/component_testing/client/private/include/client_impl.h Wed Oct  2 09:01:20 2013
@@ -0,0 +1,33 @@
+/*
+ * client_impl.h
+ *
+ *  Created on: Feb 2, 2012
+ *      Author: alexander
+ */
+
+#ifndef CLIENT_IMPL_H_
+#define CLIENT_IMPL_H_
+
+#include <celix_errno.h>
+#include <apr_general.h>
+#include "bundle_context.h"
+
+#include "server.h"
+
+typedef struct client *client_t;
+
+struct client {
+	apr_pool_t *pool;
+	server_service_t server;
+	BUNDLE_CONTEXT context;
+};
+
+celix_status_t client_create(apr_pool_t *pool, BUNDLE_CONTEXT context, client_t *client);
+celix_status_t client_doo(client_t client, int a, int b, int *reply);
+
+celix_status_t client_addingService(void *clientP, SERVICE_REFERENCE reference, void **service);
+celix_status_t client_addedService(void *clientP, SERVICE_REFERENCE reference, void *service);
+celix_status_t client_modifiedService(void *clientP, SERVICE_REFERENCE reference, void *service);
+celix_status_t client_removedService(void *clientP, SERVICE_REFERENCE reference, void *service);
+
+#endif /* CLIENT_IMPL_H_ */

Added: incubator/celix/trunk/examples/component_testing/client/private/src/client_activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/client/private/src/client_activator.c?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/client/private/src/client_activator.c (added)
+++ incubator/celix/trunk/examples/component_testing/client/private/src/client_activator.c Wed Oct  2 09:01:20 2013
@@ -0,0 +1,67 @@
+/*
+ * client_activator.c
+ *
+ *  Created on: Feb 2, 2012
+ *      Author: alexander
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <apr_general.h>
+
+#include "bundle_activator.h"
+#include "bundle_context.h"
+#include "service_tracker.h"
+
+#include "client_impl.h"
+
+struct userData {
+	apr_pool_t *pool;
+	SERVICE_TRACKER tracker;
+};
+
+celix_status_t bundleActivator_create(BUNDLE_CONTEXT context, void **userData) {
+	apr_pool_t *pool;
+	celix_status_t status = bundleContext_getMemoryPool(context, &pool);
+	if (status == CELIX_SUCCESS) {
+		*userData = apr_palloc(pool, sizeof(struct userData));
+		((struct userData *)(*userData))->pool = pool;
+		((struct userData *)(*userData))->tracker = NULL;
+	} else {
+		status = CELIX_START_ERROR;
+	}
+	return CELIX_SUCCESS;
+}
+
+celix_status_t bundleActivator_start(void * userData, BUNDLE_CONTEXT context) {
+	struct userData * data = (struct userData *) userData;
+	client_t client = NULL;
+	client_create(data->pool, context, &client);
+
+	SERVICE_TRACKER_CUSTOMIZER cust = (SERVICE_TRACKER_CUSTOMIZER) apr_palloc(data->pool, sizeof(*cust));
+	cust->handle = client;
+	cust->addedService = client_addedService;
+	cust->addingService = client_addingService;
+	cust->modifiedService = client_modifiedService;
+	cust->removedService = client_removedService;
+	serviceTracker_create(data->pool, context, "server", cust, &data->tracker);
+	serviceTracker_open(data->tracker);
+
+	int reply;
+	client_doo(client, 1, 2, &reply);
+	printf("Reply: %d\n", reply);
+
+	return CELIX_SUCCESS;
+}
+
+celix_status_t bundleActivator_stop(void * userData, BUNDLE_CONTEXT context) {
+	struct userData * data = (struct userData *) userData;
+
+	serviceTracker_close(data->tracker);
+
+	return CELIX_SUCCESS;
+}
+
+celix_status_t bundleActivator_destroy(void * userData, BUNDLE_CONTEXT context) {
+	return CELIX_SUCCESS;
+}

Added: incubator/celix/trunk/examples/component_testing/client/private/src/client_impl.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/client/private/src/client_impl.c?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/client/private/src/client_impl.c (added)
+++ incubator/celix/trunk/examples/component_testing/client/private/src/client_impl.c Wed Oct  2 09:01:20 2013
@@ -0,0 +1,67 @@
+/*
+ * client_impl.c
+ *
+ *  Created on: Feb 2, 2012
+ *      Author: alexander
+ */
+
+#include <stdlib.h>
+
+#include "client_impl.h"
+
+celix_status_t client_create(apr_pool_t *pool, BUNDLE_CONTEXT context, client_t *client) {
+	celix_status_t status = CELIX_SUCCESS;
+
+	*client = apr_palloc(pool, sizeof(**client));
+	if (!*client) {
+		status = CELIX_ENOMEM;
+	} else {
+		(*client)->pool = pool;
+		(*client)->server = NULL;
+		(*client)->context = context;
+	}
+
+	return status;
+}
+
+celix_status_t client_doo(client_t client, int a, int b, int *reply) {
+	if (client->server != NULL) {
+		client->server->server_doo(client->server->server, a, b, reply);
+	}
+	return CELIX_SUCCESS;
+}
+
+celix_status_t client_addingService(void *clientP, SERVICE_REFERENCE reference, void **service) {
+	client_t client = clientP;
+
+	bundleContext_getService(client->context, reference, service);
+
+
+	return CELIX_SUCCESS;
+}
+
+celix_status_t client_addedService(void *clientP, SERVICE_REFERENCE reference, void *service) {
+	client_t client = clientP;
+
+	printf("Added service\n");
+	client->server = service;
+
+	return CELIX_SUCCESS;
+}
+
+celix_status_t client_modifiedService(void *clientP, SERVICE_REFERENCE reference, void *service) {
+	client_t client = clientP;
+
+	client->server = service;
+
+	return CELIX_SUCCESS;
+}
+
+celix_status_t client_removedService(void *clientP, SERVICE_REFERENCE reference, void *service) {
+	client_t client = clientP;
+
+	printf("Removed service\n");
+	client->server = NULL;
+
+	return CELIX_SUCCESS;
+}

Added: incubator/celix/trunk/examples/component_testing/client/private/test/client_test.cpp
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/client/private/test/client_test.cpp?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/client/private/test/client_test.cpp (added)
+++ incubator/celix/trunk/examples/component_testing/client/private/test/client_test.cpp Wed Oct  2 09:01:20 2013
@@ -0,0 +1,84 @@
+/*
+ * client_test.c
+ *
+ *  Created on: Feb 2, 2012
+ *      Author: alexander
+ */
+
+#include "CppUTest/TestHarness.h"
+#include "CppUTest/CommandLineTestRunner.h"
+#include "CppUTestExt/MockSupport.h"
+
+extern "C" {
+	#include <stdio.h>
+	#include <stdlib.h>
+	#include <celix_errno.h>
+
+	#include "CppUTestExt/MockSupport_c.h"
+
+	#include "server.h"
+	#include "client_impl.h"
+
+	celix_status_t server_doo(server_t server, int a, int b, int *reply);
+
+	celix_status_t server_doo(server_t server, int a, int b, int *reply) {
+		mock_c()->actualCall("server_doo")
+				->withIntParameters("a", a)
+				->withIntParameters("b", b)
+				->withPointerParameters("reply", reply);
+
+		return mock_c()->returnValue().value.intValue;
+	}
+}
+
+MockFunctionCall& ServerDoExpectAndReturn(int a, int b, int *reply, celix_status_t ret) {
+	return mock()
+			.expectOneCall("server_doo")
+			.withParameter("a", a)
+			.withParameter("b", b)
+			.withParameter("reply", reply)
+			.andReturnValue(ret);
+}
+
+
+int main(int argc, char** argv) {
+	return RUN_ALL_TESTS(argc, argv);
+}
+
+//START: testGroup
+TEST_GROUP(client) {
+
+	server_service_t server;
+	client_t client;
+
+    void setup() {
+    	server = (server_service_t) malloc(sizeof(*server));
+    	server->server = NULL;
+    	server->server_doo = server_doo;
+
+    	apr_pool_t *pool;
+    	apr_initialize();
+    	apr_pool_create(&pool, NULL);
+    	client_create(pool, NULL, &client);
+    }
+
+    void teardown()
+    {
+    	mock().checkExpectations();
+    	mock().clear();
+    	free(server);
+    	server = NULL;
+    	apr_terminate();
+    }
+};
+//END: testGroup
+
+TEST(client, doo) {
+	int i = 3;
+	ServerDoExpectAndReturn(1, 2, &i, CELIX_SUCCESS);
+
+	client_addedService(client, NULL, server);
+	client_doo(client, 1, 2, &i);
+
+	CHECK_EQUAL_C_INT(3, i);
+}

Added: incubator/celix/trunk/examples/component_testing/server/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/server/CMakeLists.txt?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/server/CMakeLists.txt (added)
+++ incubator/celix/trunk/examples/component_testing/server/CMakeLists.txt Wed Oct  2 09:01:20 2013
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+bundle(server SOURCES private/src/server_activator private/src/server_impl)
+include_directories("${PROJECT_SOURCE_DIR}/celix")
+include_directories("private/include")
+include_directories("public/include")
+include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+target_link_libraries(server framework)

Added: incubator/celix/trunk/examples/component_testing/server/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/server/META-INF/MANIFEST.MF?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/server/META-INF/MANIFEST.MF (added)
+++ incubator/celix/trunk/examples/component_testing/server/META-INF/MANIFEST.MF Wed Oct  2 09:01:20 2013
@@ -0,0 +1,5 @@
+Bundle-SymbolicName: server
+Bundle-Version: 1.0.0
+library: server
+Export-Service: server
+Import-Service: server

Added: incubator/celix/trunk/examples/component_testing/server/private/include/server_impl.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/server/private/include/server_impl.h?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/server/private/include/server_impl.h (added)
+++ incubator/celix/trunk/examples/component_testing/server/private/include/server_impl.h Wed Oct  2 09:01:20 2013
@@ -0,0 +1,24 @@
+/*
+ * server_impl.h
+ *
+ *  Created on: Feb 2, 2012
+ *      Author: alexander
+ */
+
+#ifndef SERVER_IMPL_H_
+#define SERVER_IMPL_H_
+
+#include <apr_general.h>
+
+#include <celix_errno.h>
+
+#include "server.h"
+
+struct server {
+	int oldReply;
+};
+
+celix_status_t server_create(apr_pool_t *pool, server_t *server);
+celix_status_t server_doo(server_t server, int a, int b, int *reply);
+
+#endif /* SERVER_IMPL_H_ */

Added: incubator/celix/trunk/examples/component_testing/server/private/src/server_activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/server/private/src/server_activator.c?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/server/private/src/server_activator.c (added)
+++ incubator/celix/trunk/examples/component_testing/server/private/src/server_activator.c Wed Oct  2 09:01:20 2013
@@ -0,0 +1,58 @@
+/*
+ * server_activator.c
+ *
+ *  Created on: Feb 2, 2012
+ *      Author: alexander
+ */
+#include <stdlib.h>
+#include <stdio.h>
+#include <apr_general.h>
+
+#include "bundle_activator.h"
+#include "bundle_context.h"
+
+#include "server_impl.h"
+
+struct userData {
+	apr_pool_t *pool;
+	SERVICE_REGISTRATION serverReg;
+};
+
+celix_status_t bundleActivator_create(BUNDLE_CONTEXT context, void **userData) {
+	apr_pool_t *pool;
+	celix_status_t status = bundleContext_getMemoryPool(context, &pool);
+	if (status == CELIX_SUCCESS) {
+		*userData = apr_palloc(pool, sizeof(struct userData));
+		((struct userData *)(*userData))->serverReg = NULL;
+		((struct userData *)(*userData))->pool = pool;
+	} else {
+		status = CELIX_START_ERROR;
+	}
+	return CELIX_SUCCESS;
+}
+
+celix_status_t bundleActivator_start(void * userData, BUNDLE_CONTEXT context) {
+	struct userData * data = (struct userData *) userData;
+	server_service_t serverService = NULL;
+	server_t server = NULL;
+	server_create(data->pool, &server);
+
+	serverService = apr_palloc(data->pool, sizeof(*serverService));
+	serverService->server = server;
+	serverService->server_doo = server_doo;
+
+	bundleContext_registerService(context, SERVER_NAME, serverService, NULL, &data->serverReg);
+
+
+	return CELIX_SUCCESS;
+}
+
+celix_status_t bundleActivator_stop(void * userData, BUNDLE_CONTEXT context) {
+	struct userData * data = (struct userData *) userData;
+	serviceRegistration_unregister(data->serverReg);
+	return CELIX_SUCCESS;
+}
+
+celix_status_t bundleActivator_destroy(void * userData, BUNDLE_CONTEXT context) {
+	return CELIX_SUCCESS;
+}

Added: incubator/celix/trunk/examples/component_testing/server/private/src/server_impl.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/server/private/src/server_impl.c?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/server/private/src/server_impl.c (added)
+++ incubator/celix/trunk/examples/component_testing/server/private/src/server_impl.c Wed Oct  2 09:01:20 2013
@@ -0,0 +1,27 @@
+/*
+ * server_impl.c
+ *
+ *  Created on: Feb 2, 2012
+ *      Author: alexander
+ */
+
+#include "server_impl.h"
+
+celix_status_t server_create(apr_pool_t *pool, server_t *server) {
+	celix_status_t status = CELIX_SUCCESS;
+
+	*server = apr_palloc(pool, sizeof(**server));
+	if (!*server) {
+		status = CELIX_ENOMEM;
+	} else {
+		(*server)->oldReply = -1;
+	}
+
+	return status;
+}
+
+celix_status_t server_doo(server_t server, int a, int b, int *reply) {
+	*reply = a + b;
+
+	return CELIX_SUCCESS;
+}

Added: incubator/celix/trunk/examples/component_testing/server/public/include/server.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/component_testing/server/public/include/server.h?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/examples/component_testing/server/public/include/server.h (added)
+++ incubator/celix/trunk/examples/component_testing/server/public/include/server.h Wed Oct  2 09:01:20 2013
@@ -0,0 +1,22 @@
+/*
+ * server.h
+ *
+ *  Created on: Feb 2, 2012
+ *      Author: alexander
+ */
+
+#ifndef SERVER_H_
+#define SERVER_H_
+
+#define SERVER_NAME "server"
+
+typedef struct server *server_t;
+
+typedef struct server_service *server_service_t;
+
+struct server_service {
+	server_t server;
+	celix_status_t (*server_doo)(server_t server, int a, int b, int *reply);
+};
+
+#endif /* SERVER_H_ */

Modified: incubator/celix/trunk/framework/private/test/framework_test.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/test/framework_test.c?rev=1528380&r1=1528379&r2=1528380&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/test/framework_test.c (original)
+++ incubator/celix/trunk/framework/private/test/framework_test.c Wed Oct  2 09:01:20 2013
@@ -24,6 +24,7 @@
  *  \copyright	Apache License, Version 2.0
  */
 #include <stdio.h>
+#include <stdlib.h>
 
 #include <stddef.h>
 

Modified: incubator/celix/trunk/framework/public/include/service_event.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/service_event.h?rev=1528380&r1=1528379&r2=1528380&view=diff
==============================================================================
--- incubator/celix/trunk/framework/public/include/service_event.h (original)
+++ incubator/celix/trunk/framework/public/include/service_event.h Wed Oct  2 09:01:20 2013
@@ -42,6 +42,8 @@ enum serviceEventType
 	SERVICE_EVENT_MODIFIED_ENDMATCH = 0x00000008,
 };
 
+#include "service_reference.h"
+
 struct serviceEvent {
 	service_reference_pt reference;
 	service_event_type_e type;

Modified: incubator/celix/trunk/utils/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/utils/CMakeLists.txt?rev=1528380&r1=1528379&r2=1528380&view=diff
==============================================================================
--- incubator/celix/trunk/utils/CMakeLists.txt (original)
+++ incubator/celix/trunk/utils/CMakeLists.txt Wed Oct  2 09:01:20 2013
@@ -70,4 +70,14 @@ if (UTILS) 
     run_test(hash_map_test)
     run_test(hash_map_test_hash)
     run_test(linked_list_test)
+    
+    run_unity_test(unity_bla SOURCE private/test/testUnity.c MOCKS public/include/tomock.h)
+    #add_test(unity_bla ${CMAKE_CURRENT_BINARY_DIR}/unity_bla)
+    
+    #SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -fnested-functions ${CMAKE_C_FLAGS}")
+    
+    #include_directories(${PROJECT_SOURCE_DIR}/cmake/cpputest/include)
+    #link_directories(${PROJECT_SOURCE_DIR}/cmake/cpputest/lib)
+    #add_executable(testcpputest private/test/testcpputest.cpp)
+    #target_link_libraries(testcpputest CppUTest CppUTestExt)
 endif (UTILS)

Added: incubator/celix/trunk/utils/private/test/testUnity.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/utils/private/test/testUnity.c?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/utils/private/test/testUnity.c (added)
+++ incubator/celix/trunk/utils/private/test/testUnity.c Wed Oct  2 09:01:20 2013
@@ -0,0 +1,33 @@
+/*
+ * testUnity.c
+ *
+ *  Created on: Jan 30, 2012
+ *      Author: alexander
+ */
+#include <stdlib.h>
+
+#include "unity.h"
+#include "tomock.h"
+#include "Mocktomock.h"
+
+void setUp(void) {
+}
+
+void tearDown(void) {
+}
+
+int FunctionName() {
+	FunctionToMock(1, 2);
+	return 8;
+}
+
+void testVerifyThatUnityIsAwesomeAndWillMakeYourLifeEasier(void) {
+	TEST_ASSERT_TRUE(1);
+}
+
+void test_FunctionName_WorksProperlyAndAlwaysReturns8(void) {
+
+	FunctionToMock_ExpectAndReturn(1,3, 3);
+
+	TEST_ASSERT_EQUAL(8, FunctionName());
+}

Added: incubator/celix/trunk/utils/private/test/testcpputest.cpp
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/utils/private/test/testcpputest.cpp?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/utils/private/test/testcpputest.cpp (added)
+++ incubator/celix/trunk/utils/private/test/testcpputest.cpp Wed Oct  2 09:01:20 2013
@@ -0,0 +1,170 @@
+//- ------------------------------------------------------------------
+//-    Copyright (c) James W. Grenning -- All Rights Reserved
+//-    For use by owners of Test-Driven Development for Embedded C,
+//-    and attendees of Renaissance Software Consulting, Co. training
+//-    classes.
+//-
+//-    Available at http://pragprog.com/titles/jgade/
+//-        ISBN 1-934356-62-X, ISBN13 978-1-934356-62-3
+//-
+//-    Authorized users may use this source code in your own
+//-    projects, however the source code may not be used to
+//-    create training material, courses, books, articles, and
+//-    the like. We make no guarantees that this source code is
+//-    fit for any purpose.
+//-
+//-    www.renaissancesoftware.net james@renaissancesoftware.net
+//- ------------------------------------------------------------------
+
+
+#include "CppUTest/TestHarness.h"
+#include "CppUTest/CommandLineTestRunner.h"
+#include "CppUTestExt/MockSupport.h"
+
+extern "C"
+{
+#include <stdio.h>
+#include <memory.h>
+
+#include "CppUTestExt/MockSupport_c.h"
+
+	int toTest(int a, int b);
+
+	int toTest(int a, int b) {
+		mock_c()->actualCall("toTest")
+				->withIntParameters("a", a)
+				->withIntParameters("b", b);
+
+	   return mock_c()->returnValue().value.intValue;
+	}
+
+	void doTest(int c) {
+		toTest(1, 2);
+	}
+}
+
+int main(int argc, char** argv) {
+	return RUN_ALL_TESTS(argc, argv);
+}
+
+//START: testGroup
+TEST_GROUP(sprintf)
+{
+    char output[100];
+    const char * expected;
+
+    void setup()
+    {
+        memset(output, 0xaa, sizeof output);
+        expected = "";
+    }
+
+    void teardown()
+    {
+    	mock().checkExpectations();
+    	mock().clear();
+    }
+
+    void expect(const char * s)
+    {
+        expected = s;
+    }
+
+    void given(int charsWritten)
+    {
+        LONGS_EQUAL(strlen(expected), charsWritten);
+        STRCMP_EQUAL(expected, output);
+        BYTES_EQUAL(0xaa, output[strlen(expected) + 1]);
+    }
+};
+//END: testGroup
+
+#if 0 //START: RefactoredTests
+TEST(sprintf, NoFormatOperations)
+{
+	mock()
+		.expectOneCall("toTest")
+		.withParameter("a", 2)
+		.withParameter("b", 2)
+		.andReturnValue((int) 3);
+
+	doTest(3);
+    expect("hey");
+    given(sprintf(output, "hey"));
+}
+
+TEST(sprintf, InsertString)
+{
+    expect("Hello World\n");
+    given(sprintf(output, "%s\n", "Hello World"));
+}
+//END: RefactoredTests
+
+#else //START: Duplication
+//START: FormatSpace
+TEST(sprintf, NoFormatOperations)
+{
+    char output[5];
+    memset(output, 0xaa, sizeof output);
+
+    LONGS_EQUAL(3, sprintf(output, "hey"));
+    STRCMP_EQUAL("hey", output);
+    BYTES_EQUAL(0xaa, output[2]);
+}
+//END: FormatSpace
+
+TEST(sprintf, InsertString)
+{
+    char output[20];
+    memset(output, 0xaa, sizeof output);
+
+    LONGS_EQUAL(12, sprintf(output, "%s\n", "Hello World"));
+    STRCMP_EQUAL("Hello World\n", output);
+    BYTES_EQUAL(0xaa, output[13]);
+}
+//END: Duplication
+#endif
+
+#if 0 //START: NoFormatOperations1
+TEST(sprintf, NoFormatOperations)
+{
+    char output[5];
+
+    LONGS_EQUAL(3, sprintf(output, "hey"));
+    STRCMP_EQUAL("hey", output);
+}
+//END: NoFormatOperations1
+#endif
+
+#if 0 //START: NoFormatOperations2
+TEST(sprintf, NoFormatOperations)
+{
+    char output[5] = "";
+
+    LONGS_EQUAL(3, sprintf(output, "hey"));
+    STRCMP_EQUAL("hey", output);
+}
+//END: NoFormatOperations2
+#endif
+
+
+#if 0 //START: oneString
+TEST(sprintf, InsertString)
+{
+    char output[20] = "";
+
+    LONGS_EQUAL(12, sprintf(output, "%s\n", "Hello World"));
+    STRCMP_EQUAL("Hello World\n", output);
+}
+//END: oneString
+#endif
+
+#if 0 //START: failingTest
+TEST(sprintf, NoFormatOperations)
+{
+    char output[5];
+
+    LONGS_EQUAL(4, sprintf(output, "hey"));
+    STRCMP_EQUAL("hey", output);
+}
+#endif //END: failingTest

Modified: incubator/celix/trunk/utils/public/include/exports.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/utils/public/include/exports.h?rev=1528380&r1=1528379&r2=1528380&view=diff
==============================================================================
--- incubator/celix/trunk/utils/public/include/exports.h (original)
+++ incubator/celix/trunk/utils/public/include/exports.h Wed Oct  2 09:01:20 2013
@@ -43,7 +43,7 @@ We are using the Visual Studio Compiler 
     #define  UTILS_EXPORT __declspec(dllimport)
   #endif /* celix_utils_EXPORTS */
 #else /* defined (_WIN32) */
-#define UTILS_EXPORT __attribute__((visibility("default")))
+  #define UTILS_EXPORT __attribute__((visibility("default")))
 #endif
 
 #endif /* EXPORTS_H_ */

Added: incubator/celix/trunk/utils/public/include/tomock.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/utils/public/include/tomock.h?rev=1528380&view=auto
==============================================================================
--- incubator/celix/trunk/utils/public/include/tomock.h (added)
+++ incubator/celix/trunk/utils/public/include/tomock.h Wed Oct  2 09:01:20 2013
@@ -0,0 +1,14 @@
+/*
+ * tomock.h
+ *
+ *  Created on: Jan 30, 2012
+ *      Author: alexander
+ */
+
+#ifndef TOMOCK_H_
+#define TOMOCK_H_
+
+int FunctionToMock(int a, int b);
+
+
+#endif /* TOMOCK_H_ */