xref: /aoo41x/main/udm/source/unittest/test.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #include <precomp.h>
29 
30 
31 // NOT FULLY DEFINED SERVICES
32 #include <udm/integer_i.hxx>
33 #include <udm/string_i.hxx>
34 
35 using namespace udm;
36 
37 // TypeSystem      aTypeSys;
38 
39 
40 class Function
41 {
42   public:
43 
44     intt                nId;
45 };
46 
47 class Ctor : public Function
48 {
49   public:
50 
51     csv::String         sClassName;
52 };
53 
54 class Method : public Function
55 {
56   public:
57 
58     csv::String         sFunctionName;
59     std::vector< std::pair< intt, String > >
60                         aParameters;
61 };
62 
63 
64 class PrObj
65 {
66   public:
67     intt                nId;
68     csv::String         sName;
69     std::vector< PrObj* >
70                         aMethods;
71     std::vector< PrObj* >
72                         aData;
73 };
74 
75 
76 
77 
78 void fx()
79 {
80     intt            n = 5;
81     Dyn<Integer_i>  px = new Integer_i(n);
82     Integer &       x = *px;
83 
84     csv::String     s;
85     Dyn<String_i>   ps = new String_i(s);
86     String &        xs = *ps;
87 
88     xs = "Hallo";
89 
90     int dev01 = 2;
91 
92     xs = csv::String("Haha");
93 
94     dev01 = 2;
95 
96     csv::String s2 = xs;
97 
98 
99     dev01 = 2;
100 
101 //  const char * pc = xs;
102 
103 
104     intt a = x;
105     x = 15;
106 
107     Cout() << a << " " << x << Endl();  // Must be:   5 15
108 }
109 
110 
111 
112 
113