Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/range/test/mfc.cpp @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1// Boost.Range library
2//
3//  Copyright Thorsten Ottosen 2003-2004. Use, modification and
4//  distribution is subject to the Boost Software License, Version
5//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
6//  http://www.boost.org/LICENSE_1_0.txt)
7//
8// For more information, see http://www.boost.org/libs/range/
9//
10
11#define _MSL_USING_NAMESPACE 1
12
13#include <boost/detail/workaround.hpp>
14
15#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
16#  pragma warn -8091 // supress warning in Boost.Test
17#  pragma warn -8057 // unused argument argc/argv in Boost.Test
18#endif
19
20#define BOOST_RANGE_ENABLE_MFC
21#define BOOST_RANGE_ENABLE_MCF_CARRAY
22
23/*
24#define WIN32
25#define _WINDOWS
26#define _MBCS
27#define _AFXDLL
28#define _ATL_DLL
29*/
30
31///Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_MBCS" /D "_AFXDLL" /D "_ATL_DLL" /Gm /EHsc /RTC1
32// /MDd /Zc:wchar_t /Yu"stdafx.h" /Fp"Debug/Foo.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /nologo /c /Wp64 /ZI /TP
33
34#include <boost/range.hpp>
35#include <boost/range/detail/mfc/carray.hpp>
36#include <boost/range/detail/mfc/cstring.hpp>
37
38#include <boost/test/test_tools.hpp>
39#include <boost/config.hpp>
40
41
42void check_mfc()
43{
44    CString s = "hello world";
45    BOOST_CHECK( boost::begin( s ) + boost::size( s ) == boost::end( s ) );
46    BOOST_CHECK( boost::size( s ) == boost::size( "hello world" ) );
47    BOOST_CHECK( !boost::empty( s ) );
48    const CString cs( s );
49    BOOST_CHECK( boost::begin( cs ) + boost::size( cs ) == boost::end( cs ) );
50    BOOST_CHECK( boost::size( cs ) == boost::size( "hello world" ) );
51    BOOST_CHECK( !boost::empty( cs ) );
52   
53    CArray<int,int> a;
54    BOOST_CHECK( boost::empty( a ) );
55    a.Add( 5 );
56    a.Add( 10 );
57    BOOST_CHECK( boost::begin( a ) + boost::size( a ) == boost::end( a ) );
58    BOOST_CHECK( boost::size( a ) == 2 );
59    BOOST_CHECK( !boost::empty( a ) );
60    const CArray<int,int>& ca = a;
61    BOOST_CHECK( boost::begin( ca ) + boost::size( ca ) == boost::end( ca ) );
62    BOOST_CHECK( boost::size( ca ) == 2 );
63    BOOST_CHECK( !boost::empty( ca ) );
64   
65}
66
67
68
69#include <boost/test/unit_test.hpp>
70using boost::unit_test::test_suite;
71
72
73test_suite* init_unit_test_suite( int argc, char* argv[] )
74{
75    test_suite* test = BOOST_TEST_SUITE( "Range Test Suite" );
76
77    test->add( BOOST_TEST_CASE( &check_mfc ) );
78
79    return test;
80}
81
82
83
84
85
86
Note: See TracBrowser for help on using the repository browser.