Let's make the tests also compile with boost 1.33 (auto_unit_test.hpp is
[platform/upstream/libzypp.git] / tests / zypp / Arch_test.cc
1 // Arch.cc
2 //
3 // tests for Arch
4 //
5
6 #include <iostream>
7 #include <list>
8 #include <string>
9
10 #include "zypp/base/Logger.h"
11 #include "zypp/Arch.h"
12
13 // Boost.Test
14 #include <boost/test/floating_point_comparison.hpp>
15 #include <boost/test/auto_unit_test.hpp>
16
17 using boost::unit_test::test_suite;
18 using boost::unit_test::test_case;
19 using boost::test_tools::close_at_tolerance;
20
21 using namespace std;
22 using namespace zypp;
23
24 /******************************************************************
25 **
26 **
27 **      FUNCTION NAME : main
28 **      FUNCTION TYPE : int
29 **
30 **      DESCRIPTION :
31 */
32 BOOST_AUTO_TEST_CASE(arch_test)
33 {
34   Arch _arch32( "i386" );
35
36   BOOST_CHECK_EQUAL( _arch32, Arch_i386 );
37   BOOST_CHECK_EQUAL( _arch32.asString(), string("i386"));
38   BOOST_REQUIRE( _arch32.compatibleWith (Arch_x86_64));
39   BOOST_CHECK_THROW( Arch(NULL), exception);
40   BOOST_CHECK_EQUAL( Arch(), Arch_noarch );
41   BOOST_REQUIRE( Arch("") != Arch_noarch );
42   BOOST_REQUIRE( Arch("").empty() );
43   BOOST_REQUIRE( ! Arch_noarch.empty() );
44   BOOST_REQUIRE( ! ( _arch32.compare(Arch_x86_64) >= 0) );
45 }