osl_Socket_tests.cxx (87d2adbc) | osl_Socket_tests.cxx (63d99982) |
---|---|
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 --- 15 unchanged lines hidden (view full) --- 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 | 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 --- 15 unchanged lines hidden (view full) --- 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> | 32#include "gtest/gtest.h" |
33#include <osl/socket.hxx> 34//------------------------------------------------------------------------ 35// helper functions 36//------------------------------------------------------------------------ 37 38//------------------------------------------------------------------------ 39// tests cases begins here 40//------------------------------------------------------------------------ 41 42namespace osl_Socket 43{ 44 | 33#include <osl/socket.hxx> 34//------------------------------------------------------------------------ 35// helper functions 36//------------------------------------------------------------------------ 37 38//------------------------------------------------------------------------ 39// tests cases begins here 40//------------------------------------------------------------------------ 41 42namespace osl_Socket 43{ 44 |
45 class tests : public CppUnit::TestFixture | 45 class tests : public ::testing::Test |
46 { 47 public: | 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 | 48 }; 49 |
62 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(osl_Socket::tests, "osl_SocketTest"); | 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 } |
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 73void 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 | 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 67void 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 |
82NOADDITIONAL; | 76int main(int argc, char **argv) 77{ 78 ::testing::InitGoogleTest(&argc, argv); 79 return RUN_ALL_TESTS(); 80} |
83 84//#endif | 81 82//#endif |