Commit 8d74101f authored by Vadim Levin's avatar Vadim Levin Committed by Alexander Alekhin

Merge pull request #15955 from VadimLevin:dev/vlevin/generator_tests

Tests for argument conversion of Python bindings generator

* Tests for parsing elemental types from Python bindings

  - Add positive and negative tests for int, float, double, size_t,
    const char*, bool.
  - Tests with wrong conversion behavior are skipped.

* Move implicit conversion of bool to integer/floating types to wrong
conversion behavior.
parent 41af8aa0
......@@ -20,6 +20,44 @@ CV_EXPORTS_W String dumpInputOutputArray(InputOutputArray argument);
CV_EXPORTS_W String dumpInputOutputArrayOfArrays(InputOutputArrayOfArrays argument);
CV_WRAP static inline
String dumpBool(bool argument)
{
return (argument) ? String("Bool: True") : String("Bool: False");
}
CV_WRAP static inline
String dumpInt(int argument)
{
return cv::format("Int: %d", argument);
}
CV_WRAP static inline
String dumpSizeT(size_t argument)
{
std::ostringstream oss("size_t: ", std::ios::ate);
oss << argument;
return oss.str();
}
CV_WRAP static inline
String dumpFloat(float argument)
{
return cv::format("Float: %.2f", argument);
}
CV_WRAP static inline
String dumpDouble(double argument)
{
return cv::format("Double: %.2f", argument);
}
CV_WRAP static inline
String dumpCString(const char* argument)
{
return cv::format("String: %s", argument);
}
CV_WRAP static inline
AsyncArray testAsyncArray(InputArray argument)
{
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment