3 This script will test highgui's window handle/name functionality
6 # name of this test and it's requirements
7 TESTNAME = "cvGetWindowHandleName"
8 REQUIRED = ["cvNamedWindow"]
11 # needed for sys.exit(int) and .works file handling
15 # check requirements and delete old flag file, if it exists
16 if not works.check_files(REQUIRED,TESTNAME):
19 # import the necessary things for OpenCV
25 win_name = "testing..."
27 # create a window ( 'cvNamedWindow.works' says: "Ok, go for it!" )
28 cvNamedWindow(win_name,CV_WINDOW_AUTOSIZE)
30 # check if the window handle and the according name are correct
31 win_name_2 = cvGetWindowName( cvGetWindowHandle(win_name) )
32 if win_name_2!=win_name:
33 # print "(ERROR) Incorrect window handle/name."
37 cvDestroyWindow( win_name )
39 # create flag file for following tests
40 works.set_file(TESTNAME)