1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Fixed highgui tests for Android

This commit is contained in:
Andrey Kamaev
2011-12-20 07:45:49 +00:00
parent 54adb3c9cf
commit 4168a698f6
6 changed files with 679 additions and 618 deletions
+22 -18
View File
@@ -43,13 +43,15 @@
#include "test_precomp.hpp"
#include "opencv2/highgui/highgui.hpp"
#if defined HAVE_GTK || defined HAVE_QT || defined WIN32 || defined _WIN32 || HAVE_CARBON || HAVE_COCOA
using namespace cv;
using namespace std;
class CV_HighGuiOnlyGuiTest : public cvtest::BaseTest
{
protected:
void run(int);
protected:
void run(int);
};
void Foo(int /*k*/, void* /*z*/) {}
@@ -57,30 +59,32 @@ void Foo(int /*k*/, void* /*z*/) {}
void CV_HighGuiOnlyGuiTest::run( int /*start_from */)
{
ts->printf(ts->LOG, "GUI 1\n");
namedWindow("Win");
namedWindow("Win");
ts->printf(ts->LOG, "GUI 2\n");
Mat m(256, 256, CV_8U);
m = Scalar(128);
ts->printf(ts->LOG, "GUI 2\n");
Mat m(256, 256, CV_8U);
m = Scalar(128);
ts->printf(ts->LOG, "GUI 3\n");
imshow("Win", m);
ts->printf(ts->LOG, "GUI 3\n");
imshow("Win", m);
ts->printf(ts->LOG, "GUI 4\n");
int value = 50;
ts->printf(ts->LOG, "GUI 4\n");
int value = 50;
ts->printf(ts->LOG, "GUI 5\n");
createTrackbar( "trackbar", "Win", &value, 100, Foo, &value);
ts->printf(ts->LOG, "GUI 5\n");
createTrackbar( "trackbar", "Win", &value, 100, Foo, &value);
ts->printf(ts->LOG, "GUI 6\n");
getTrackbarPos( "trackbar", "Win" );
ts->printf(ts->LOG, "GUI 6\n");
getTrackbarPos( "trackbar", "Win" );
ts->printf(ts->LOG, "GUI 7\n");
waitKey(500);
ts->printf(ts->LOG, "GUI 7\n");
waitKey(500);
ts->printf(ts->LOG, "GUI 8\n");
cvDestroyAllWindows();
ts->printf(ts->LOG, "GUI 8\n");
cvDestroyAllWindows();
ts->set_failed_test_info(cvtest::TS::OK);
}
TEST(Highgui_GUI, regression) { CV_HighGuiOnlyGuiTest test; test.safe_run(); }
#endif