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 "gtest/gtest.h" 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 ::testing::Test 46 { 47 public: 48 }; 49 50 TEST_F(tests, test_001) 51 { 52 // _osl_getFullQualifiedDomainName( ); 53 oslSocketResult aResult; 54 rtl::OUString suHostname = osl::SocketAddr::getLocalHostname(&aResult); 55 ASSERT_TRUE(aResult == osl_Socket_Ok) << "getLocalHostname failed"; 56 } 57 } 58 59 60 // ----------------------------------------------------------------------------- 61 62 // this macro creates an empty function, which will called by the RegisterAllFunctions() 63 // to let the user the possibility to also register some functions by hand. 64 65 /*#if (defined LINUX) 66 67 void RegisterAdditionalFunctions( FktRegFuncPtr _pFunc ) 68 { 69 // for cover lines in _osl_getFullQualifiedDomainName( ) 70 // STAR_OVERRIDE_DOMAINNAME is more an internal HACK for 5.2, which should remove from sal 71 setenv( "STAR_OVERRIDE_DOMAINNAME", "PRC.Sun.COM", 0 ); 72 } 73 74 #else*/ 75 76 int main(int argc, char **argv) 77 { 78 ::testing::InitGoogleTest(&argc, argv); 79 return RUN_ALL_TESTS(); 80 } 81 82 //#endif 83