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
21 from python.highgui import *
22 from python.cv import *
26 win_name = "testing..."
28 # create a window ( 'cvNamedWindow.works' says: "Ok, go for it!" )
29 cvNamedWindow(win_name,CV_WINDOW_AUTOSIZE)
31 # check if the window handle and the according name are correct
32 win_name_2 = cvGetWindowName( cvGetWindowHandle(win_name) )
33 if win_name_2!=win_name:
34 # print "(ERROR) Incorrect window handle/name."
38 cvDestroyWindow( win_name )
40 # create flag file for following tests
41 works.set_file(TESTNAME)