MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / checkWindowColor

Function checkWindowColor

server/dlfakerut-test.c:55–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53
54
55static int checkWindowColor(Display *dpy, Window win, unsigned int color)
56{
57 int fakerColor, retval = 0;
58 typedef int (*_vgl_getAutotestColorType)(Display *, Window, int);
59 _vgl_getAutotestColorType _vgl_getAutotestColor;
60
61 _vgl_getAutotestColor =
62 (_vgl_getAutotestColorType)dlsym(RTLD_DEFAULT, "_vgl_getAutotestColor");
63 if(!_vgl_getAutotestColor)
64 THROW("Can't communicate w/ faker");
65 fakerColor = _vgl_getAutotestColor(dpy, win, 0);
66 if(fakerColor < 0 || fakerColor > 0xffffff)
67 THROW("Bogus data read back");
68 if((unsigned int)fakerColor != color)
69 {
70 fprintf(stderr, "Color is 0x%.6x, should be 0x%.6x\n", fakerColor, color);
71 retval = -1;
72 }
73
74 bailout:
75 return retval;
76}
77
78
79static int checkFrame(Display *dpy, Window win, int desiredReadbacks,

Callers 1

testFunction · 0.70

Calls 1

_vgl_getAutotestColorFunction · 0.85

Tested by

no test coverage detected