From 802d004bbbc0b4e32f2307c90c09ebf3717efd41 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Sat, 13 Apr 2013 16:53:59 +0400 Subject: [PATCH] Fix build issues --- modules/ts/include/opencv2/ts/ts_gtest.h | 10 ++++++++++ modules/ts/src/ts_gtest.cpp | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/ts/include/opencv2/ts/ts_gtest.h b/modules/ts/include/opencv2/ts/ts_gtest.h index ea22aba30..2d1227ecd 100644 --- a/modules/ts/include/opencv2/ts/ts_gtest.h +++ b/modules/ts/include/opencv2/ts/ts_gtest.h @@ -7155,11 +7155,21 @@ GTEST_API_ std::string AppendUserMessage( // errors presumably detectable only at run time. Since // std::runtime_error inherits from std::exception, many testing // frameworks know how to extract and print the message inside it. + +#ifdef _MSC_VER +# pragma warning(push) // Saves the current warning state. +# pragma warning(disable:4275) // Temporarily disables warning 4275. +#endif // _MSC_VER + class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error { public: explicit GoogleTestFailureException(const TestPartResult& failure); }; +#ifdef _MSC_VER +# pragma warning(pop) // Restores the warning state. +#endif // _MSC_VER + #endif // GTEST_HAS_EXCEPTIONS // A helper class for creating scoped traces in user programs. diff --git a/modules/ts/src/ts_gtest.cpp b/modules/ts/src/ts_gtest.cpp index cc7744e72..7c388cbd4 100644 --- a/modules/ts/src/ts_gtest.cpp +++ b/modules/ts/src/ts_gtest.cpp @@ -3284,7 +3284,7 @@ static std::string FormatWordList(const std::vector& words) { return word_list.GetString(); } -bool ValidateTestPropertyName(const std::string& property_name, +static bool ValidateTestPropertyName(const std::string& property_name, const std::vector& reserved_names) { if (std::find(reserved_names.begin(), reserved_names.end(), property_name) != reserved_names.end()) {