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 /* Check .unusedlibbase option with base1 */
28 if (PeropenerNoLib() != 1)
29 Printf("Error calling PeropenerNoLib()\n");
31 /* Set value for base2 */
32 PeropenerBase
= base2
;
35 /* Check value for base2 */
36 Printf((STRPTR
)"Checking value for base2: 2 == %ld %s\n",
37 PeropenerGetValue(), (PeropenerGetValue() == 2) ? "OK" : "FAIL!"
40 /* Check value for base2 */
41 PeropenerBase
= base1
;
43 Printf((STRPTR
)"Checking value for base1: 1 == %ld %s\n",
44 PeropenerGetValue(), (PeropenerGetValue() == 1) ? "OK" : "FAIL!"
47 FPrintf(Output(), (STRPTR
)"base1=%lx, base2=%lx\n", base1
, base2
);
54 FPuts(Output(), (STRPTR
)"\nTesting pertask.library\n");
56 base1
=OpenLibrary((STRPTR
)"pertask.library",0);
57 base2
=OpenLibrary((STRPTR
)"pertask.library",0);
59 FPrintf(Output(), (STRPTR
)"base1=%lx, base2=%lx\n", base1
, base2
);
61 seglist
= LoadSeg((CONST_STRPTR
)"peropenertest_child");
62 if (seglist
!= (BPTR
)NULL
)
64 SetProgramName("peropenertest_child");
65 RunCommand(seglist
, 10*1024, "\n", 1);
70 FPrintf(Output(), (STRPTR
)"Failed to load peropenertest_child\n");