1 | /* |
---|
2 | * ====================================================================== |
---|
3 | * Copyright (c) 2004-2005 Purdue Research Foundation |
---|
4 | * |
---|
5 | * See the file "license.terms" for information on usage and |
---|
6 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
7 | * ====================================================================== |
---|
8 | */ |
---|
9 | #include "RpBoolean.h" |
---|
10 | |
---|
11 | int test_setPath(RpBoolean* myBoolean); |
---|
12 | int test_setDefaultValue(RpBoolean* myBoolean); |
---|
13 | int test_setCurrentValue(RpBoolean* myBoolean); |
---|
14 | int test_setLabel(RpBoolean* myBoolean); |
---|
15 | int test_setDesc(RpBoolean* myBoolean); |
---|
16 | |
---|
17 | int test_setPath(RpBoolean* myBoolean) |
---|
18 | { |
---|
19 | std::cout << "Path " << myBoolean->getPath() << std::endl; |
---|
20 | myBoolean->setPath("input.(ambiant)"); |
---|
21 | std::cout << "Path " << myBoolean->getPath() << std::endl; |
---|
22 | |
---|
23 | return 1; |
---|
24 | } |
---|
25 | |
---|
26 | |
---|
27 | int test_setDefaultValue(RpBoolean* myBoolean) |
---|
28 | { |
---|
29 | std::cout << "defaultVal " << myBoolean->getDefaultValue() << std::endl; |
---|
30 | myBoolean->setDefaultValue("new default value"); |
---|
31 | std::cout << "defaultVal " << myBoolean->getDefaultValue() << std::endl; |
---|
32 | |
---|
33 | return 1; |
---|
34 | } |
---|
35 | |
---|
36 | int test_setCurrentValue(RpBoolean* myBoolean) |
---|
37 | { |
---|
38 | std::cout << "currentVal " << myBoolean->getCurrentValue() << std::endl; |
---|
39 | myBoolean->setCurrentValue("new current value"); |
---|
40 | std::cout << "currentVal " << myBoolean->getCurrentValue() << std::endl; |
---|
41 | |
---|
42 | return 1; |
---|
43 | } |
---|
44 | |
---|
45 | int test_setLabel(RpBoolean* myBoolean) |
---|
46 | { |
---|
47 | std::cout << "label " << myBoolean->getLabel() << std::endl; |
---|
48 | myBoolean->setLabel("newLabel"); |
---|
49 | std::cout << "label " << myBoolean->getLabel() << std::endl; |
---|
50 | |
---|
51 | return 1; |
---|
52 | } |
---|
53 | |
---|
54 | int test_setDesc(RpBoolean* myBoolean) |
---|
55 | { |
---|
56 | std::cout << "desc " << myBoolean->getDesc() << std::endl; |
---|
57 | myBoolean->setDesc("new description"); |
---|
58 | std::cout << "desc " << myBoolean->getDesc() << std::endl; |
---|
59 | |
---|
60 | return 1; |
---|
61 | } |
---|
62 | |
---|
63 | int main () |
---|
64 | { |
---|
65 | |
---|
66 | RpBoolean* T1 = new RpBoolean("input.(ambient).(temperature)","default-string"); |
---|
67 | RpBoolean* T2 = new RpBoolean("input.(ambient).(temperature)", |
---|
68 | "default-string", |
---|
69 | "boolean2's label", |
---|
70 | "boolean2's desc" |
---|
71 | ); |
---|
72 | |
---|
73 | |
---|
74 | std::cout << "T1 run" << std::endl; |
---|
75 | test_setPath(T1); |
---|
76 | test_setDefaultValue(T1); |
---|
77 | test_setCurrentValue(T1); |
---|
78 | test_setLabel(T1); |
---|
79 | test_setDesc(T1); |
---|
80 | |
---|
81 | std::cout << std::endl; |
---|
82 | |
---|
83 | std::cout << "T2 run" << std::endl; |
---|
84 | test_setPath(T2); |
---|
85 | test_setDefaultValue(T2); |
---|
86 | test_setCurrentValue(T2); |
---|
87 | test_setLabel(T2); |
---|
88 | test_setDesc(T2); |
---|
89 | |
---|
90 | std::cout << std::endl; |
---|
91 | std::cout << std::endl; |
---|
92 | |
---|
93 | return 0; |
---|
94 | } |
---|