1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sal.hxx"
26 
27 //------------------------------------------------------------------------
28 // include files
29 //------------------------------------------------------------------------
30 #include <osl_Socket_Const.h>
31 
32 #include <testshl/simpleheader.hxx>
33 #include <osl/socket.hxx>
34 //------------------------------------------------------------------------
35 // helper functions
36 //------------------------------------------------------------------------
37 
38 //------------------------------------------------------------------------
39 // tests cases begins here
40 //------------------------------------------------------------------------
41 
42 namespace osl_Socket
43 {
44 
45 	class tests : public CppUnit::TestFixture
46 	{
47 	public:
48 
49 		void test_001()
50             {
51                 // _osl_getFullQualifiedDomainName( );
52                 oslSocketResult aResult;
53                 rtl::OUString suHostname = osl::SocketAddr::getLocalHostname(&aResult);
54                 CPPUNIT_ASSERT_MESSAGE("getLocalHostname failed", aResult == osl_Socket_Ok);
55             }
56 
57 		CPPUNIT_TEST_SUITE( tests );
58 		CPPUNIT_TEST( test_001 );
59 		CPPUNIT_TEST_SUITE_END();
60     };
61 
62     CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::tests, "osl_SocketTest");
63 }
64 
65 
66 // -----------------------------------------------------------------------------
67 
68 // this macro creates an empty function, which will called by the RegisterAllFunctions()
69 // to let the user the possibility to also register some functions by hand.
70 
71 /*#if (defined LINUX)
72 
73 void RegisterAdditionalFunctions( FktRegFuncPtr _pFunc )
74 {
75 	// for cover lines in _osl_getFullQualifiedDomainName( )
76 	// STAR_OVERRIDE_DOMAINNAME is more an internal HACK for 5.2, which should remove from sal
77 	setenv( "STAR_OVERRIDE_DOMAINNAME", "PRC.Sun.COM", 0 );
78 }
79 
80 #else*/
81 
82 NOADDITIONAL;
83 
84 //#endif
85