source: trunk/test/src/RpBoolean_test.cc @ 115

Last change on this file since 115 was 115, checked in by mmc, 19 years ago

Updated all copyright notices.

File size: 2.6 KB
RevLine 
[115]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 */
[40]9#include "RpBoolean.h"
10
11int test_setPath(RpBoolean* myBoolean);
12int test_setDefaultValue(RpBoolean* myBoolean);
13int test_setCurrentValue(RpBoolean* myBoolean);
14int test_setLabel(RpBoolean* myBoolean);
15int test_setDesc(RpBoolean* myBoolean);
16
17int 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
27int 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
36int 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
45int 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
54int 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
63int 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}
Note: See TracBrowser for help on using the repository browser.