1 #include <rfb/rfb.h>
2
main(int argc,char ** argv)3 int main(int argc,char** argv)
4 {
5 int fake_argc=6;
6 char* fake_argv[6]={
7 "dummy_program","-alwaysshared","-httpport","3002","-nothing","-dontdisconnect"
8 };
9 rfbScreenInfoPtr screen;
10 rfbBool ret=0;
11
12 screen = rfbGetScreen(&fake_argc,fake_argv,1024,768,8,3,1);
13 if(!screen)
14 return 0;
15
16 #define CHECK(a,b) if(screen->a!=b) { fprintf(stderr,#a " is %d (should be " #b ")\n",screen->a); ret=1; }
17 CHECK(width,1024);
18 CHECK(height,768);
19 CHECK(alwaysShared,TRUE);
20 CHECK(httpPort,3002);
21 CHECK(dontDisconnect,TRUE);
22 if(fake_argc!=2) {
23 fprintf(stderr,"fake_argc is %d (should be 2)\n",fake_argc);
24 ret=1;
25 }
26 if(strcmp(fake_argv[1],"-nothing")) {
27 fprintf(stderr,"fake_argv[1] is %s (should be -nothing)\n",fake_argv[1]);
28 ret=1;
29 }
30 return ret;
31 }
32
33