1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: test_ostringstream.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_testshl2.hxx"
40 #include <sal/types.h>
43 class TestFactoryRegistry
46 void checkFunc(char* foo
);
47 void checkFunc2(char* foo
);
48 void checkFunc3(char* foo
);
52 void TestFactoryRegistry::checkFunc(char* /* foo */ )
54 static int serialNumber
= 1;
56 std::ostringstream ost
;
57 //! could this be the problem?
58 ost
<< "@Dummy@" << serialNumber
++;
59 std::cout
<< ost
.str() << std::endl
;
62 void TestFactoryRegistry::checkFunc2(char* /* foo */)
64 static int serialNumber
= 1;
66 std::ostringstream ost
;
67 //! could this be the problem?
68 ost
<< "@Dummy@" << serialNumber
;
70 std::cout
<< ost
.str() << std::endl
;
73 void TestFactoryRegistry::checkFunc3(char* /* foo */)
75 static int serialNumber
= 1;
77 int nValue
= serialNumber
;
78 std::ostringstream ost
;
79 //! could this be the problem?
80 ost
<< "@Dummy@" << nValue
;
82 std::cout
<< ost
.str() << std::endl
;
85 static TestFactoryRegistry a
;
86 static TestFactoryRegistry b
;
87 static TestFactoryRegistry c
;
89 // ----------------------------------- Main -----------------------------------
90 #if (defined UNX) || (defined OS2)
91 int main( int /* argc */ , char* /* argv */ [] )
93 int _cdecl
main( int /* argc */, char* /* argv */ [] )
96 std::ostringstream ost
;
97 // sal_Int32 nValue = 1;
99 // ost << "@Dummy@" << nValue;
100 // ost << "dec: " << 15 << std::hex << " hex: " << 15 << std::endl;
102 // std::cout << ost.str() << std::endl;