Itseez/opencv — pull request #1890 by alalek (2013-11-29 01:18:36+00:00)
Title: TS: catch & append general exceptions into log

Sample of output with unhandled "Access violation" (0xc0000005 on Windows) error.
We see in LOG only OpenCV Error, which is expected and it is succesfully processed via try-catch (it is not a reason of failure):

```
..\..\..\opencv\modules\ts\src\ts.cpp(505): error: Failed

failure reason: Hardware/OS exception
test case #-1
seed: ffffffffffffffff
-----------------------------------
LOG: OpenCV Error: Unknown error code -220 (OpenCL function is not available: [clGetPlatformIDs]) in opencl_check_fn, file ..\..\..\opencv\modules\core\src\opencl\runtime\ocl_runtime.cpp, line 137

-----------------------------------
```

New output, where we can see real reason of failure with more details (instead of Hardware/OS exception) and more easily:

```
..\..\..\opencv\modules\ts\src\ts.cpp(518): error: Failed

failure reason: Invalid memory access
test case #-1
seed: ffffffffffffffff
-----------------------------------
LOG:
OpenCV Error:
Unknown error code -220 (OpenCL function is not available: [clGetPlatformIDs]) in opencl_check_fn, file ..\..\..\opencv\modules\core\src\opencl\runtime\ocl_runtime.cpp, line 137

General failure:
Invalid memory access (-5)

-----------------------------------
\
```