X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=test%2Fwrapper.cpp;fp=test%2Fwrapper.cpp;h=2b2e41f30c63e12cf0a2768d3397e7468265d018;hp=0000000000000000000000000000000000000000;hb=ffbbf9abeb195a4017c1ede383cc9ab906aa4a0c;hpb=e98b5dc1fe10ed25b986fc5cfb8fd0ba2f329a3a diff --git a/test/wrapper.cpp b/test/wrapper.cpp new file mode 100644 index 0000000..2b2e41f --- /dev/null +++ b/test/wrapper.cpp @@ -0,0 +1,82 @@ +/*************************************************************************** + * Copyright (C) 2004 by Intra2net AG * + * info@intra2net.com * + * * + ***************************************************************************/ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#ifdef HAVE_CONFIG_H +#include +#endif + +using namespace std; +using namespace libt2n; +using namespace CppUnit; + +class testme : public command_client +{ + public: + + testme(client_connection &x, long long a, long long b) + : command_client(x,100000,10000) + { } + + void helloworld(const std::string& text) + { + std::cout << "Hello world, " << text << std::endl; + } +}; + +typedef T2nSingletonWrapper wraptype; + +template<> +std::auto_ptr wraptype::SingletonObject = std::auto_ptr(); + +template<> +std::auto_ptr wraptype::WrappedConnection = std::auto_ptr(); + +class test_wrapper : public TestFixture +{ + CPPUNIT_TEST_SUITE(test_wrapper); + + CPPUNIT_TEST(simple_wrap); + + CPPUNIT_TEST_SUITE_END(); + + public: + + void setUp() + { } + + void tearDown() + { } + + void simple_wrap() + { +// t2n_exec(&testme::helloworld)("gurke"); + + CPPUNIT_ASSERT_EQUAL(true,true); + } + + +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(test_wrapper);