os/ossrv/stdcpp/tsrc/Boost_test/variant/src/test4.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/stdcpp/tsrc/Boost_test/variant/src/test4.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,60 @@
     1.4 +//-----------------------------------------------------------------------------
     1.5 +// boost-libs variant/test/test4.cpp source file
     1.6 +// See http://www.boost.org for updates, documentation, and revision history.
     1.7 +//-----------------------------------------------------------------------------
     1.8 +//
     1.9 +// Copyright (c) 2003
    1.10 +// Eric Friedman, Itay Maman
    1.11 +//
    1.12 +// Distributed under the Boost Software License, Version 1.0. (See
    1.13 +// accompanying file LICENSE_1_0.txt or copy at
    1.14 +// http://www.boost.org/LICENSE_1_0.txt)
    1.15 +/*
    1.16 + * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
    1.17 +*/
    1.18 +
    1.19 +#include "boost/test/minimal.hpp"
    1.20 +#include "boost/variant.hpp"
    1.21 +
    1.22 +#include "jobs.h"
    1.23 +
    1.24 +#include <string>
    1.25 +#ifdef __SYMBIAN32__
    1.26 +#include "std_log_result.h"
    1.27 +#define LOG_FILENAME_LINE __FILE__, __LINE__
    1.28 +#endif
    1.29 +struct class_a;
    1.30 +
    1.31 +using boost::variant;
    1.32 +
    1.33 +typedef variant<std::string, class_a, float> var_type_1;
    1.34 +typedef variant<std::string, class_a, short> var_type_2;
    1.35 +
    1.36 +#include "class_a.h"
    1.37 +
    1.38 +int test_main(int , char* [])
    1.39 +{
    1.40 +   using namespace boost;
    1.41 +std_log(LOG_FILENAME_LINE,"[Test Case for test4]");
    1.42 +   var_type_1 v1;
    1.43 +   var_type_2 v2;
    1.44 +
    1.45 +   v1 = class_a();
    1.46 +   verify(v1, spec<class_a>(), "[V] class_a(5511)");
    1.47 +
    1.48 +   verify(v2, spec<std::string>(), "[V] ");
    1.49 +
    1.50 +   v2 = "abcde";
    1.51 +   verify(v2, spec<std::string>(), "[V] abcde");
    1.52 +
    1.53 +   v2 = v1;
    1.54 +   verify(v2, spec<class_a>(), "[V] class_a(5511)");
    1.55 +
    1.56 +   v2 = 5;
    1.57 +   v1 = v2;
    1.58 +#ifdef __SYMBIAN32__
    1.59 +   	testResultXml("test4");
    1.60 +	close_log_file();
    1.61 +#endif
    1.62 +   return boost::exit_success;
    1.63 +}