diff --git a/c/common/build/windows/common.sln b/c/common/build/windows/common.sln index 1151e6ad..1e305bd0 100644 --- a/c/common/build/windows/common.sln +++ b/c/common/build/windows/common.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.40629.0 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "common.vcxproj", "{9F55377B-6C37-4700-9866-E070D64ADE0F}" EndProject diff --git a/c/common/build/windows/common.vcxproj b/c/common/build/windows/common.vcxproj index cc1b9fa8..8c5556f8 100644 --- a/c/common/build/windows/common.vcxproj +++ b/c/common/build/windows/common.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -25,25 +25,25 @@ StaticLibrary true - v120 + v140 MultiByte StaticLibrary true - v120 + v140 MultiByte StaticLibrary false - v120 + v140 MultiByte StaticLibrary false - v120 + v140 MultiByte diff --git a/c/common/unittests/buffer_unittests/buffer_unittests.vcxproj b/c/common/unittests/buffer_unittests/buffer_unittests.vcxproj index 12d0f403..3f662b2b 100644 --- a/c/common/unittests/buffer_unittests/buffer_unittests.vcxproj +++ b/c/common/unittests/buffer_unittests/buffer_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -19,14 +19,14 @@ DynamicLibrary true - v120 + v140 MultiByte false DynamicLibrary false - v120 + v140 true MultiByte false diff --git a/c/common/unittests/crtabstractions_unittests/crtabstractions_unittests.vcxproj b/c/common/unittests/crtabstractions_unittests/crtabstractions_unittests.vcxproj index 13b78765..47ded9d7 100644 --- a/c/common/unittests/crtabstractions_unittests/crtabstractions_unittests.vcxproj +++ b/c/common/unittests/crtabstractions_unittests/crtabstractions_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -19,14 +19,14 @@ DynamicLibrary true - v120 + v140 MultiByte false DynamicLibrary false - v120 + v140 true MultiByte false diff --git a/c/common/unittests/doublylinkedlist_unittests/doublylinkedlist_unittests.vcxproj b/c/common/unittests/doublylinkedlist_unittests/doublylinkedlist_unittests.vcxproj index a5a47d7b..44046dd4 100644 --- a/c/common/unittests/doublylinkedlist_unittests/doublylinkedlist_unittests.vcxproj +++ b/c/common/unittests/doublylinkedlist_unittests/doublylinkedlist_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -28,14 +28,14 @@ DynamicLibrary true - v120 + v140 MultiByte false DynamicLibrary true - v120 + v140 MultiByte false true @@ -43,7 +43,7 @@ DynamicLibrary false - v120 + v140 true MultiByte false @@ -51,7 +51,7 @@ DynamicLibrary false - v120 + v140 true MultiByte false diff --git a/c/common/unittests/gballoc_unittests/gballoc_unittests.vcxproj b/c/common/unittests/gballoc_unittests/gballoc_unittests.vcxproj index 892ed525..7ea56880 100644 --- a/c/common/unittests/gballoc_unittests/gballoc_unittests.vcxproj +++ b/c/common/unittests/gballoc_unittests/gballoc_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -19,14 +19,14 @@ DynamicLibrary true - v120 + v140 MultiByte false DynamicLibrary false - v120 + v140 true MultiByte false diff --git a/c/common/unittests/gballoc_without_init_unittests/gballoc_without_init_unittests.vcxproj b/c/common/unittests/gballoc_without_init_unittests/gballoc_without_init_unittests.vcxproj index c899dcd3..79083835 100644 --- a/c/common/unittests/gballoc_without_init_unittests/gballoc_without_init_unittests.vcxproj +++ b/c/common/unittests/gballoc_without_init_unittests/gballoc_without_init_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,14 +20,14 @@ DynamicLibrary true - v120 + v140 MultiByte false DynamicLibrary false - v120 + v140 true MultiByte false diff --git a/c/common/unittests/httpheaders_unittests/httpheaders_unittests.vcxproj b/c/common/unittests/httpheaders_unittests/httpheaders_unittests.vcxproj index 404a7c19..84b5cb84 100644 --- a/c/common/unittests/httpheaders_unittests/httpheaders_unittests.vcxproj +++ b/c/common/unittests/httpheaders_unittests/httpheaders_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -27,14 +27,14 @@ DynamicLibrary true - v120 + v140 MultiByte false DynamicLibrary true - v120 + v140 MultiByte false true diff --git a/c/common/unittests/lock_unittests/lock_unittests.vcxproj b/c/common/unittests/lock_unittests/lock_unittests.vcxproj index 7a3664ec..fee4c7cb 100644 --- a/c/common/unittests/lock_unittests/lock_unittests.vcxproj +++ b/c/common/unittests/lock_unittests/lock_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -35,14 +35,14 @@ DynamicLibrary true - v120 + v140 Unicode false DynamicLibrary false - v120 + v140 true Unicode false diff --git a/c/common/unittests/map_unittests/map_unittests.vcxproj b/c/common/unittests/map_unittests/map_unittests.vcxproj index dcffe777..62892593 100644 --- a/c/common/unittests/map_unittests/map_unittests.vcxproj +++ b/c/common/unittests/map_unittests/map_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,14 +20,14 @@ DynamicLibrary true - v120 + v140 MultiByte false DynamicLibrary false - v120 + v140 true MultiByte false diff --git a/c/common/unittests/string_tokenizer_unittests/string_tokenizer_unittests.vcxproj b/c/common/unittests/string_tokenizer_unittests/string_tokenizer_unittests.vcxproj index bd5b51ba..db1c9ff2 100644 --- a/c/common/unittests/string_tokenizer_unittests/string_tokenizer_unittests.vcxproj +++ b/c/common/unittests/string_tokenizer_unittests/string_tokenizer_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -19,13 +19,13 @@ DynamicLibrary true - v120 + v140 MultiByte DynamicLibrary false - v120 + v140 true MultiByte diff --git a/c/common/unittests/strings_unittests/strings_unittests.vcxproj b/c/common/unittests/strings_unittests/strings_unittests.vcxproj index 4b4040b4..e46c769d 100644 --- a/c/common/unittests/strings_unittests/strings_unittests.vcxproj +++ b/c/common/unittests/strings_unittests/strings_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -19,13 +19,13 @@ DynamicLibrary true - v120 + v140 MultiByte DynamicLibrary false - v120 + v140 true MultiByte diff --git a/c/common/unittests/urlencode_unittests/urlencode_unittests.vcxproj b/c/common/unittests/urlencode_unittests/urlencode_unittests.vcxproj index fef027c9..0c2c2984 100644 --- a/c/common/unittests/urlencode_unittests/urlencode_unittests.vcxproj +++ b/c/common/unittests/urlencode_unittests/urlencode_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -19,13 +19,13 @@ DynamicLibrary true - v120 + v140 MultiByte DynamicLibrary false - v120 + v140 true MultiByte diff --git a/c/common/unittests/vector_unittests/vector_unittests.vcxproj b/c/common/unittests/vector_unittests/vector_unittests.vcxproj index 83db42b5..cf559be2 100644 --- a/c/common/unittests/vector_unittests/vector_unittests.vcxproj +++ b/c/common/unittests/vector_unittests/vector_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -27,14 +27,14 @@ DynamicLibrary true - v120 + v140 MultiByte false DynamicLibrary true - v120 + v140 MultiByte false true diff --git a/c/eventhub_client/build/windows/eventhubclient.vcxproj b/c/eventhub_client/build/windows/eventhubclient.vcxproj index 93758094..78585149 100644 --- a/c/eventhub_client/build/windows/eventhubclient.vcxproj +++ b/c/eventhub_client/build/windows/eventhubclient.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -26,26 +26,26 @@ StaticLibrary true - v120 + v140 MultiByte StaticLibrary true - v120 + v140 MultiByte StaticLibrary false - v120 + v140 true MultiByte StaticLibrary false - v120 + v140 true MultiByte diff --git a/c/eventhub_client/samples/send/windows/send.vcxproj b/c/eventhub_client/samples/send/windows/send.vcxproj index b8ea986a..0e3489e9 100644 --- a/c/eventhub_client/samples/send/windows/send.vcxproj +++ b/c/eventhub_client/samples/send/windows/send.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,13 +20,13 @@ Application true - v120 + v140 Unicode Application false - v120 + v140 true Unicode diff --git a/c/eventhub_client/samples/send_batch/windows/send_batch.vcxproj b/c/eventhub_client/samples/send_batch/windows/send_batch.vcxproj index 37b5f945..b850682f 100644 --- a/c/eventhub_client/samples/send_batch/windows/send_batch.vcxproj +++ b/c/eventhub_client/samples/send_batch/windows/send_batch.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,13 +20,13 @@ Application true - v120 + v140 Unicode Application false - v120 + v140 true Unicode diff --git a/c/eventhub_client/samples/sendasync/windows/sendasync.vcxproj b/c/eventhub_client/samples/sendasync/windows/sendasync.vcxproj index 2c5e9ce1..1769f123 100644 --- a/c/eventhub_client/samples/sendasync/windows/sendasync.vcxproj +++ b/c/eventhub_client/samples/sendasync/windows/sendasync.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,13 +20,13 @@ Application true - v120 + v140 Unicode Application false - v120 + v140 true Unicode diff --git a/c/eventhub_client/samples/serialization_oss_lib/send.c b/c/eventhub_client/samples/serialization_oss_lib/send.c index 2f9f86d2..7bfd1806 100644 --- a/c/eventhub_client/samples/serialization_oss_lib/send.c +++ b/c/eventhub_client/samples/serialization_oss_lib/send.c @@ -39,6 +39,8 @@ SOFTWARE. #include #include +// Serialization library information can be found http://ccodearchive.net/info/json.html + static const char* connectionString = "Endpoint=sb://[namespace].servicebus.windows.net/;SharedAccessKeyName=[key name];SharedAccessKey=[key value]"; static const char* eventHubPath = "[event hub name]"; diff --git a/c/eventhub_client/unittests/eventdata_unittests/eventdata_unittests.vcxproj b/c/eventhub_client/unittests/eventdata_unittests/eventdata_unittests.vcxproj index 8592e31d..3afa45a4 100644 --- a/c/eventhub_client/unittests/eventdata_unittests/eventdata_unittests.vcxproj +++ b/c/eventhub_client/unittests/eventdata_unittests/eventdata_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -19,13 +19,13 @@ DynamicLibrary true - v120 + v140 MultiByte DynamicLibrary false - v120 + v140 true MultiByte diff --git a/c/eventhub_client/unittests/eventhubclient_e2etests/eventhubclient_e2etests.vcxproj b/c/eventhub_client/unittests/eventhubclient_e2etests/eventhubclient_e2etests.vcxproj index c9984d1b..1bc770e5 100644 --- a/c/eventhub_client/unittests/eventhubclient_e2etests/eventhubclient_e2etests.vcxproj +++ b/c/eventhub_client/unittests/eventhubclient_e2etests/eventhubclient_e2etests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -28,14 +28,14 @@ DynamicLibrary true - v120 + v140 MultiByte false DynamicLibrary true - v120 + v140 MultiByte false true @@ -43,7 +43,7 @@ DynamicLibrary false - v120 + v140 true MultiByte false @@ -51,7 +51,7 @@ DynamicLibrary false - v120 + v140 true MultiByte false diff --git a/c/eventhub_client/unittests/eventhubclient_ll_unittests/eventhubclient_ll_unittests.vcxproj b/c/eventhub_client/unittests/eventhubclient_ll_unittests/eventhubclient_ll_unittests.vcxproj index fcc38bc1..1b80480d 100644 --- a/c/eventhub_client/unittests/eventhubclient_ll_unittests/eventhubclient_ll_unittests.vcxproj +++ b/c/eventhub_client/unittests/eventhubclient_ll_unittests/eventhubclient_ll_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,13 +20,13 @@ DynamicLibrary true - v120 + v140 MultiByte DynamicLibrary false - v120 + v140 true MultiByte diff --git a/c/eventhub_client/unittests/eventhubclient_unittests/eventhubclient_unittests.vcxproj b/c/eventhub_client/unittests/eventhubclient_unittests/eventhubclient_unittests.vcxproj index fe1c625d..95e2bce8 100644 --- a/c/eventhub_client/unittests/eventhubclient_unittests/eventhubclient_unittests.vcxproj +++ b/c/eventhub_client/unittests/eventhubclient_unittests/eventhubclient_unittests.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,13 +20,13 @@ DynamicLibrary true - v120 + v140 MultiByte DynamicLibrary false - v120 + v140 true MultiByte diff --git a/c/testtools/micromock/build/windows/micromock.sln b/c/testtools/micromock/build/windows/micromock.sln index 84d17388..2cf5f9b7 100644 --- a/c/testtools/micromock/build/windows/micromock.sln +++ b/c/testtools/micromock/build/windows/micromock.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "micromock", "micromock.vcxproj", "{236FD5EB-D669-44A2-9732-DB96C56E7384}" EndProject diff --git a/c/testtools/micromock/build/windows/micromock.vcxproj b/c/testtools/micromock/build/windows/micromock.vcxproj index b07094c1..6398d5be 100644 --- a/c/testtools/micromock/build/windows/micromock.vcxproj +++ b/c/testtools/micromock/build/windows/micromock.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -19,13 +19,13 @@ StaticLibrary true - v120 + v140 MultiByte StaticLibrary true - v120 + v140 MultiByte diff --git a/c/testtools/micromock/inc/micromockenumtostring.h b/c/testtools/micromock/inc/micromockenumtostring.h index 49a7c2a5..760eb5c9 100644 --- a/c/testtools/micromock/inc/micromockenumtostring.h +++ b/c/testtools/micromock/inc/micromockenumtostring.h @@ -75,7 +75,7 @@ namespace Microsoft \ { \ __VA_ARGS__ \ }; \ - template <> static std::wstring ToString < EnumName > (const EnumName & q) \ + template <> std::wstring ToString < EnumName > (const EnumName & q) \ { \ if((size_t)q>=sizeof(EnumName##_Strings)/sizeof(EnumName##_Strings[0])) \ { \ diff --git a/c/testtools/micromock/inc/micromocktestrunnerhooks.h b/c/testtools/micromock/inc/micromocktestrunnerhooks.h index de4c5fca..3875f2eb 100644 --- a/c/testtools/micromock/inc/micromocktestrunnerhooks.h +++ b/c/testtools/micromock/inc/micromocktestrunnerhooks.h @@ -34,7 +34,12 @@ IN THE SOFTWARE. #define MOCK_ASSERT(expected, actual, assertString) ASSERT_ARE_EQUAL((expected), (actual), (assertString)) #define MOCK_FAIL(expression) ASSERT_FAIL(expression) + +#ifndef MBED_BUILD_TIMESTAMP #define MOCK_THROW(mockException) throw(mockException) +#else +#define MOCK_THROW(mockException) +#endif #else // MOCK_ASSERT #define MOCK_THROW(...) diff --git a/c/testtools/micromock/inc/mockcallargument.h b/c/testtools/micromock/inc/mockcallargument.h index 2788c02a..552b39dd 100644 --- a/c/testtools/micromock/inc/mockcallargument.h +++ b/c/testtools/micromock/inc/mockcallargument.h @@ -31,7 +31,6 @@ IN THE SOFTWARE. #include "mockvalue.h" #include "mockcallargumentbase.h" #include "micromockexception.h" -#include "memory.h" #include "stddef.h" template diff --git a/c/testtools/micromock/inc/mockmethodcall.h b/c/testtools/micromock/inc/mockmethodcall.h index 5a501dbc..445e6813 100644 --- a/c/testtools/micromock/inc/mockmethodcall.h +++ b/c/testtools/micromock/inc/mockmethodcall.h @@ -111,6 +111,13 @@ public: m_OnlySpecifiesActions = true; return *this; } + + CMockMethodCall& IgnoreAllCalls() + { + m_IgnoreAllCalls = true; + return *this; + } + CMockMethodCall& ValidateArgumentBuffer(_In_ size_t argumentNo, _In_reads_bytes_opt_(bytesToValidate) const void* expectedBuffer, _In_ size_t bytesToValidate, _In_ size_t byteOffset = 0) { diff --git a/c/testtools/micromock/inc/mockmethodcallbase.h b/c/testtools/micromock/inc/mockmethodcallbase.h index 25ad5d05..5898b9c9 100644 --- a/c/testtools/micromock/inc/mockmethodcallbase.h +++ b/c/testtools/micromock/inc/mockmethodcallbase.h @@ -47,6 +47,7 @@ public: CMockMethodCallBase* m_MatchedCall; bool m_OnlySpecifiesActions; + bool m_IgnoreAllCalls; bool m_AlwaysReport; size_t m_ExpectedTimes; size_t m_MatchedTimes; diff --git a/c/testtools/micromock/inc/strictorderedcallcomparer.h b/c/testtools/micromock/inc/strictorderedcallcomparer.h index 36e2cbef..f2a6cbd3 100644 --- a/c/testtools/micromock/inc/strictorderedcallcomparer.h +++ b/c/testtools/micromock/inc/strictorderedcallcomparer.h @@ -17,6 +17,7 @@ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT IN THE SOFTWARE. */ + #ifndef STRICTORDEREDCALLCOMPARER_H #define STRICTORDEREDCALLCOMPARER_H @@ -73,36 +74,47 @@ public: { CMockMethodCallBase* expectedCall = expectedCalls[m_ExpectedCallIndex]; - // if the expected call has not yet been matched - if (!expectedCall->HasMatch() && - // and it matches the actual call + // if the expected call says all calls of this type should be ignored, + // then match + if ((expectedCall->m_IgnoreAllCalls) && (*expectedCall == *actualCall)) - { - // check whether the number of expected calls of this type have been found - // in the actual calls array - if (expectedCall->m_MatchedTimes < expectedCall->m_ExpectedTimes) - { - // record that we found yet another actual call matching the expected call - expectedCall->m_MatchedTimes++; - if (expectedCall->m_MatchedTimes == expectedCall->m_ExpectedTimes) - { - // mark the expected call as fully matched - // (no other actual call will be matched against it) - expectedCall->m_MatchedCall = actualCall; - } + { + actualCall->m_MatchedCall = expectedCall; + expectedCall->m_MatchedCall = actualCall; + } + else + { + // if the expected call has not yet been matched + if (!expectedCall->HasMatch() && + // and it matches the actual call + (*expectedCall == *actualCall)) + { + // check whether the number of expected calls of this type have been found + // in the actual calls array + if (expectedCall->m_MatchedTimes < expectedCall->m_ExpectedTimes) + { + // record that we found yet another actual call matching the expected call + expectedCall->m_MatchedTimes++; + if (expectedCall->m_MatchedTimes == expectedCall->m_ExpectedTimes) + { + // mark the expected call as fully matched + // (no other actual call will be matched against it) + expectedCall->m_MatchedCall = actualCall; + } - // mark the actual call as having a match - actualCall->m_MatchedCall = expectedCall; - result = expectedCall; - } - else - { - // too many calls, check if exact is specified - if (expectedCall->m_ExactExpectedTimes) - { - actualCall->m_AlwaysReport = true; - } - } + // mark the actual call as having a match + actualCall->m_MatchedCall = expectedCall; + result = expectedCall; + } + else + { + // too many calls, check if exact is specified + if (expectedCall->m_ExactExpectedTimes) + { + actualCall->m_AlwaysReport = true; + } + } + } } } diff --git a/c/testtools/micromock/src/micromockexception.cpp b/c/testtools/micromock/src/micromockexception.cpp index e3360cf9..795ce1c9 100644 --- a/c/testtools/micromock/src/micromockexception.cpp +++ b/c/testtools/micromock/src/micromockexception.cpp @@ -38,8 +38,7 @@ const TCHAR* MicroMockExceptionToString(_In_ MICROMOCK_EXCEPTION exceptionCode) switch (exceptionCode) { default: - MOCK_THROW(_T("Invalid exception code")); - break; + return "Invalid exception code"; case MICROMOCK_EXCEPTION_INVALID_VALIDATE_BUFFERS: return _MACROSTR(MICROMOCK_EXCEPTION_INVALID_VALIDATE_BUFFERS); diff --git a/c/testtools/micromock/src/mockmethodcallbase.cpp b/c/testtools/micromock/src/mockmethodcallbase.cpp index f04a9531..dac9d05d 100644 --- a/c/testtools/micromock/src/mockmethodcallbase.cpp +++ b/c/testtools/micromock/src/mockmethodcallbase.cpp @@ -54,6 +54,7 @@ void CMockMethodCallBase::Init(std::tstring methodName) m_MethodName = methodName; m_MatchedCall = NULL; m_OnlySpecifiesActions = false; + m_IgnoreAllCalls = false; m_ExpectedTimes = 1; m_MatchedTimes = 0; m_AlwaysReport = false;