source: trunk/test/src/RpVariable_test.cc @ 40

Last change on this file since 40 was 40, checked in by dkearney, 18 years ago

initial add for test directory which will hold test cases for using rappture

File size: 1.8 KB
Line 
1#include "RpVariable.h"
2
3int test_getPath(RpVariable* myVariable);
4int test_getDefaultValue(RpVariable* myVariable);
5int test_getCurrentValue(RpVariable* myVariable);
6int test_getLabel(RpVariable* myVariable);
7int test_getDesc(RpVariable* myVariable);
8
9int test_getPath(RpVariable* myVariable)
10{
11    std::cout << "Path " << myVariable->getPath() << std::endl;
12
13    return 1;
14}
15
16int test_getDefaultValue(RpVariable* myVariable)
17{
18    std::cout << "defaultVal " << *((double*) myVariable->getDefaultValue()) << std::endl;
19
20    return 1;
21}
22
23int test_getCurrentValue(RpVariable* myVariable)
24{
25    std::cout << "currentVal " << myVariable->getCurrentValue() << std::endl;
26
27    return 1;
28}
29
30int test_getLabel(RpVariable* myVariable)
31{
32    std::cout << "label " << myVariable->getLabel() << std::endl;
33
34    return 1;
35}
36
37int test_getDesc(RpVariable* myVariable)
38{
39    std::cout << "desc " << myVariable->getDesc() << std::endl;
40
41    return 1;
42}
43
44
45
46int main ()
47{
48
49    RpVariable* T1 = new RpVariable("input.(ambient).(temperature)",new double(300.00));
50    /*
51    RpVariable* T2 = new RpVariable("input.(ambient).(temperature)",
52                                "K",
53                                300.00,
54                                0.00,
55                                1000.00,
56                                "Temperature",
57                                "Ambient Temperature, value between 0 and 1000"
58                                );
59    */
60   
61    test_getPath(T1);
62    test_getDefaultValue(T1);
63//    test_getCurrentValue(T1);
64    test_getLabel(T1);
65    test_getDesc(T1);
66
67    std::cout << std::endl;
68
69    /*
70    test_getPath(T2);
71    test_getUnits(T2);
72    test_getDefaultValue(T2);
73    test_getCurrentValue(T2);
74    test_getMin(T2);
75    test_getMax(T2);
76    test_getLabel(T2);
77    test_getDesc(T2);
78    */
79
80    std::cout << std::endl;
81
82    return 0;
83}
Note: See TracBrowser for help on using the repository browser.