2 Copyright © 2008-2009, The AROS Development Team. All rights reserved.
6 #include <proto/exec.h>
8 #include <proto/peropener.h>
9 #include <proto/pertask.h>
11 struct Library
*PeropenerBase
= NULL
;
13 int main (int argc
, char ** argv
)
15 struct Library
*base1
, *base2
;
18 FPuts(Output(), (STRPTR
)"Testing peropener.library\n");
20 base1
=OpenLibrary((STRPTR
)"peropener.library",0);
21 base2
=OpenLibrary((STRPTR
)"peropener.library",0);
23 /* Set value for base1 */
24 PeropenerBase
= base1
;
27 /* Set value for base2 */
28 PeropenerBase
= base2
;
31 /* Check value for base2 */
32 Printf((STRPTR
)"Checking value for base2: %s\n",
33 (PeropenerGetValue() == 2) ? "OK" : "FAIL!"
36 /* Check value for base2 */
37 PeropenerBase
= base1
;
38 Printf((STRPTR
)"Checking value for base1: %s\n",
39 (PeropenerGetValue() == 1) ? "OK" : "FAIL!"
42 FPrintf(Output(), (STRPTR
)"base1=%lx, base2=%lx\n", base1
, base2
);
49 FPuts(Output(), (STRPTR
)"\nTesting pertask.library\n");
51 base1
=OpenLibrary((STRPTR
)"pertask.library",0);
52 base2
=OpenLibrary((STRPTR
)"pertask.library",0);
54 FPrintf(Output(), (STRPTR
)"base1=%lx, base2=%lx\n", base1
, base2
);
56 seglist
= LoadSeg((CONST_STRPTR
)"peropenertest_child");
57 if (seglist
!= (BPTR
)NULL
)
59 SetProgramName("peropenertest_child");
60 RunCommand(seglist
, 10*1024, "\n", 1);
65 FPrintf(Output(), (STRPTR
)"Failed to load peropenertest_child\n");