| 53 | |
| 54 | |
| 55 | static 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 | |
| 79 | static int checkFrame(Display *dpy, Window win, int desiredReadbacks, |
no test coverage detected