mirror of
https://github.com/opencv/opencv.git
synced 2025-08-01 02:18:01 +08:00
Merge pull request #7735 from alalek:ts_cv_enum_static_fiasco
This commit is contained in:
commit
e04eb8cc04
@ -95,11 +95,11 @@ private:
|
|||||||
|
|
||||||
#define CV_ENUM(class_name, ...) \
|
#define CV_ENUM(class_name, ...) \
|
||||||
namespace { \
|
namespace { \
|
||||||
|
using namespace cv;using namespace cv::cuda; using namespace cv::ocl; \
|
||||||
struct class_name { \
|
struct class_name { \
|
||||||
class_name(int val = 0) : val_(val) {} \
|
class_name(int val = 0) : val_(val) {} \
|
||||||
operator int() const { return val_; } \
|
operator int() const { return val_; } \
|
||||||
void PrintTo(std::ostream* os) const { \
|
void PrintTo(std::ostream* os) const { \
|
||||||
using namespace cv;using namespace cv::cuda; using namespace cv::ocl; \
|
|
||||||
const int vals[] = { __VA_ARGS__ }; \
|
const int vals[] = { __VA_ARGS__ }; \
|
||||||
const char* svals = #__VA_ARGS__; \
|
const char* svals = #__VA_ARGS__; \
|
||||||
for(int i = 0, pos = 0; i < (int)(sizeof(vals)/sizeof(int)); ++i) { \
|
for(int i = 0, pos = 0; i < (int)(sizeof(vals)/sizeof(int)); ++i) { \
|
||||||
@ -115,8 +115,7 @@ private:
|
|||||||
*os << "UNKNOWN"; \
|
*os << "UNKNOWN"; \
|
||||||
} \
|
} \
|
||||||
static ::testing::internal::ParamGenerator<class_name> all() { \
|
static ::testing::internal::ParamGenerator<class_name> all() { \
|
||||||
using namespace cv;using namespace cv::cuda; using namespace cv::ocl; \
|
const class_name vals[] = { __VA_ARGS__ }; \
|
||||||
static class_name vals[] = { __VA_ARGS__ }; \
|
|
||||||
return ::testing::ValuesIn(vals); \
|
return ::testing::ValuesIn(vals); \
|
||||||
} \
|
} \
|
||||||
private: int val_; \
|
private: int val_; \
|
||||||
|
Loading…
Reference in New Issue
Block a user