How to mock 'Display' in googletest?

Viewed 28

In my program, using the API XOpenDisplay to get a Display. Then using the Display to get some XResource. Like that:

Display *dpy = XOpenDisplay(0);

char *resourceString = XResourceManagerString(dpy); 

...

XCloseDisplay(dpy);

If you want to do googletest on this program,how should I mock Display or other X11 resource?

0 Answers
Related