当前位置: 首页>>代码示例>>C++>>正文


C++ BOOST_CHECK函数代码示例

本文整理汇总了C++中BOOST_CHECK函数的典型用法代码示例。如果您正苦于以下问题:C++ BOOST_CHECK函数的具体用法?C++ BOOST_CHECK怎么用?C++ BOOST_CHECK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了BOOST_CHECK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: test_sequence_with_comparison

void test_sequence_with_comparison ( Container &v, Comp comp, typename Container::value_type minE, typename Container::value_type maxE ) {

	typedef std::pair <typename Container::iterator, typename Container::iterator> Pair;

	Pair res = ba::minmax_element ( v.begin (), v.end (), comp );
	BOOST_CHECK ( *res.first == minE );
	BOOST_CHECK ( *res.second == maxE );

	std::reverse ( v.begin (), v.end ());
	res = ba::minmax_element ( v.begin (), v.end (), comp );
	BOOST_CHECK ( *res.first == minE );
	BOOST_CHECK ( *res.second == maxE );
	
	std::random_shuffle ( v.begin (), v.end ());
	res = ba::minmax_element ( v.begin (), v.end (), comp );
	BOOST_CHECK ( *res.first == minE );
	BOOST_CHECK ( *res.second == maxE );
	
//	One element
	int v0 = v[0];
	res = ba::minmax_element ( v.begin (), v.begin () + 1, comp );
	BOOST_CHECK ( *res.first == v0 );
	BOOST_CHECK ( *res.second == v0 );
	
//	Two elements
	int v1 = v[1];
	res = ba::minmax_element ( v.begin (), v.begin () + 2, comp );
	if ( comp ( v0, v1 )) {
		BOOST_CHECK ( *res.first  == v0 );
		BOOST_CHECK ( *res.second == v1 );
		}
	else {
		BOOST_CHECK ( *res.first  == v1 );
		BOOST_CHECK ( *res.second == v0 );
		}
	
	}
开发者ID:ZaMaZaN4iK,项目名称:Boost.Algorithm,代码行数:37,代码来源:minmax_test1.cpp

示例2: test_threading_level_cmp

void
test_threading_level_cmp() {
  namespace mt = boost::mpi::threading;
  BOOST_CHECK(mt::single == mt::single);
  BOOST_CHECK(mt::funneled == mt::funneled);
  BOOST_CHECK(mt::serialized == mt::serialized);
  BOOST_CHECK(mt::multiple == mt::multiple);
  
  BOOST_CHECK(mt::single != mt::funneled);
  BOOST_CHECK(mt::single != mt::serialized);
  BOOST_CHECK(mt::single != mt::multiple);

  BOOST_CHECK(mt::funneled != mt::single);
  BOOST_CHECK(mt::funneled != mt::serialized);
  BOOST_CHECK(mt::funneled != mt::multiple);

  BOOST_CHECK(mt::serialized != mt::single);
  BOOST_CHECK(mt::serialized != mt::funneled);
  BOOST_CHECK(mt::serialized != mt::multiple);

  BOOST_CHECK(mt::multiple != mt::single);
  BOOST_CHECK(mt::multiple != mt::funneled);
  BOOST_CHECK(mt::multiple != mt::serialized);

  BOOST_CHECK(mt::single < mt::funneled);
  BOOST_CHECK(mt::funneled > mt::single);
  BOOST_CHECK(mt::single < mt::serialized);
  BOOST_CHECK(mt::serialized > mt::single);
  BOOST_CHECK(mt::single < mt::multiple);
  BOOST_CHECK(mt::multiple > mt::single);

  BOOST_CHECK(mt::funneled < mt::serialized);
  BOOST_CHECK(mt::serialized > mt::funneled);
  BOOST_CHECK(mt::funneled < mt::multiple);
  BOOST_CHECK(mt::multiple > mt::funneled);

  BOOST_CHECK(mt::serialized < mt::multiple);
  BOOST_CHECK(mt::multiple > mt::serialized);

  BOOST_CHECK(mt::single <= mt::single);
  BOOST_CHECK(mt::single <= mt::funneled);
  BOOST_CHECK(mt::funneled >= mt::single);
  BOOST_CHECK(mt::single <= mt::serialized);
  BOOST_CHECK(mt::serialized >= mt::single);
  BOOST_CHECK(mt::single <= mt::multiple);
  BOOST_CHECK(mt::multiple >= mt::single);

  BOOST_CHECK(mt::funneled <= mt::funneled);
  BOOST_CHECK(mt::funneled <= mt::serialized);
  BOOST_CHECK(mt::serialized >= mt::funneled);
  BOOST_CHECK(mt::funneled <= mt::multiple);
  BOOST_CHECK(mt::multiple >= mt::funneled);

  BOOST_CHECK(mt::serialized <= mt::serialized);
  BOOST_CHECK(mt::serialized <= mt::multiple);
  BOOST_CHECK(mt::multiple >= mt::serialized);

  BOOST_CHECK(mt::multiple <= mt::multiple);
}
开发者ID:Adikteev,项目名称:rtbkit-deps,代码行数:59,代码来源:mt_level_test.cpp

示例3: BOOST_FOREACH

 BOOST_FOREACH(const T& v, const_pre_vector) {
      BOOST_CHECK(v == real_vector[pos++]);
 }
开发者ID:1000000000001,项目名称:bitcoin,代码行数:3,代码来源:prevector_tests.cpp

示例4: test_contains

void test_contains() {
	RangeList16 rl;
	rl.merge(0, 5);
	rl.merge(6, 10);
	rl.merge(12, 15);
	rl.merge(21, 26);
	BOOST_CHECK(rl.size() == 3);
	BOOST_CHECK(rl.contains(Range16(0)));
	BOOST_CHECK(rl.contains(Range16(4)));
	BOOST_CHECK(rl.contains(Range16(6)));
	BOOST_CHECK(rl.contains(Range16(10)));
	BOOST_CHECK(!rl.contains(Range16(11)));
	BOOST_CHECK(rl.contains(Range16(12)));
	BOOST_CHECK(!rl.contains(Range16(16)));
	BOOST_CHECK(rl.contains(Range16(21)));
	BOOST_CHECK(rl.contains(Range16(26)));
	BOOST_CHECK(!rl.contains(Range16(27)));

	BOOST_CHECK(rl.getContains(0, 0) != rl.end());
	BOOST_CHECK(rl.getContains(5, 5) != rl.end());
	BOOST_CHECK(rl.getContains(12, 15) != rl.end());
	BOOST_CHECK(rl.getContains(0, 0)->begin() == 0);
	BOOST_CHECK(rl.getContains(0, 0)->end() == 10);
	BOOST_CHECK(rl.getContains(0, 5)->begin() == 0);
	BOOST_CHECK(rl.getContains(0, 5)->end() == 10);
	BOOST_CHECK(rl.getContains(12, 13)->begin() == 12);
	BOOST_CHECK(rl.getContains(12, 13)->end() == 15);
	BOOST_CHECK(rl.getContains(16, 16) == rl.end());
	BOOST_CHECK(rl.getContains(12, 20) != rl.end());
	BOOST_CHECK(rl.getContains(12, 20)->begin() == 12);
	BOOST_CHECK(rl.getContains(12, 20)->end() == 15);

	rl.push(0, 15);
	BOOST_CHECK(rl.contains(Range16(0)));
	BOOST_CHECK(rl.contains(Range16(5)));
	BOOST_CHECK(rl.contains(Range16(11)));
	BOOST_CHECK(rl.contains(Range16(12)));
	BOOST_CHECK(rl.contains(Range16(13)));

	rl.clear();
	rl.merge(0, 5);
	rl.merge(10, 15);
	rl.merge(20, 25);
	BOOST_CHECK(rl.contains(0, 2));
	BOOST_CHECK(rl.contains(3, 4));
	BOOST_CHECK(rl.contains(0, 5));
	BOOST_CHECK(rl.contains(5, 6));
	BOOST_CHECK(!rl.contains(6, 9));
	BOOST_CHECK(rl.contains(6, 10));
	BOOST_CHECK(rl.contains(Range16(10)));
	BOOST_CHECK(rl.contains(10, 10));
	BOOST_CHECK(rl.contains(10, 13));
	BOOST_CHECK(rl.contains(0, 20));
	BOOST_CHECK(!rl.contains(26, 28));
}
开发者ID:alosarv,项目名称:hydranode,代码行数:55,代码来源:test-range.cpp

示例5: test_merge

void test_merge() {
	RangeList16 rl;
	rl.push(0, 5);
	BOOST_CHECK(rl.size() == 1);
	// duplicates are allowed
	BOOST_CHECK(rl.push(0, 1));
	BOOST_CHECK(rl.push(5, 5));
	BOOST_CHECK(rl.push(0, 100));
	BOOST_CHECK(rl.size() == 4);
	rl.clear();
	rl.merge(0, 5);
	BOOST_CHECK(rl.size() == 1);
	rl.merge(5, 6);
	BOOST_CHECK(rl.size() == 1);
	rl.merge(7, 10);
	BOOST_CHECK(rl.size() == 1);
	rl.erase(5, 6);
	BOOST_CHECK(rl.size() == 2);
	rl.erase(3, 6);
	BOOST_CHECK(rl.size() == 2);
	rl.erase(0, 10);
	BOOST_CHECK(rl.size() == 0);
	rl.merge(0, 4);
	rl.merge(5, 10);
	rl.merge(4, 4);
	BOOST_CHECK(rl.size() == 1);
}
开发者ID:alosarv,项目名称:hydranode,代码行数:27,代码来源:test-range.cpp

示例6: BOOST_FIXTURE_TEST_CASE

BOOST_FIXTURE_TEST_CASE(is_a_receivable, F)
{
  logsvc::prot::Disconnect disconnect;
  BOOST_CHECK(dynamic_cast<logsvc::prot::Receivable*>(&disconnect));
}
开发者ID:erikalds,项目名称:logsvc,代码行数:5,代码来源:TestDisconnect.cpp

示例7: test_more

void test_more() {
	RangeList16 r;
	typedef Range16 RR;
	typedef RangeList16::CIter CIter;

	CIter i;

	/**************************** PART I: Adding *************************/
	BOOST_CHECK_NO_THROW(r.merge(RR(5, 10)));
	i = r.begin();
	BOOST_CHECK((*i).begin() == 5);
	BOOST_CHECK((*i).end() == 10);

	BOOST_CHECK_NO_THROW(r.merge(RR(20, 30)));
	i++;
	BOOST_CHECK((*i).begin() == 20);
	BOOST_CHECK((*i).end() == 30);
	BOOST_CHECK(r.size() == 2);

	// RC_CONTAINS_END
	BOOST_CHECK_NO_THROW(r.merge(RR(3, 6)));
	i = r.begin();
	BOOST_CHECK((*i).begin() == 3);
	BOOST_CHECK((*i).end() == 10);
	i++;
	BOOST_CHECK((*i).begin() == 20);
	BOOST_CHECK((*i).end() == 30);
	BOOST_CHECK(r.size() == 2);

	// RC_CONTAINS_FULL - list shouldn't be changed
	BOOST_CHECK_NO_THROW(r.merge(RR(4, 8)));
	BOOST_CHECK_NO_THROW(r.merge(RR(3, 4)));
	i = r.begin();
	BOOST_CHECK((*i).begin() == 3);
	BOOST_CHECK((*i).end() == 10);
	i++;
	BOOST_CHECK((*i).begin() == 20);
	BOOST_CHECK((*i).end() == 30);
	BOOST_CHECK(r.size() == 2);

	// RC_CONTAINS_BEGIN
	BOOST_CHECK_NO_THROW(r.merge(RR(8, 12)));
	i = r.begin();
	BOOST_CHECK((*i).begin() == 3);
	BOOST_CHECK((*i).end() == 12);
	i++;
	BOOST_CHECK((*i).begin() == 20);
	BOOST_CHECK((*i).end() == 30);
	BOOST_CHECK(r.size() == 2);

	// RC_BORDER_BEGIN
	BOOST_CHECK_NO_THROW(r.merge(RR(15, 19)));
	i = r.begin();
	BOOST_CHECK((*i).begin() == 3);
	BOOST_CHECK((*i).end() == 12);
	i++;
	BOOST_CHECK((*i).begin() == 15);
	BOOST_CHECK((*i).end() == 30);
	BOOST_CHECK(r.size() == 2);

	// RC_BORDER_END
	BOOST_CHECK_NO_THROW(r.merge(RR(31, 35)));
	i = r.begin();
	BOOST_CHECK((*i).begin() == 3);
	BOOST_CHECK((*i).end() == 12);
	i++;
	BOOST_CHECK((*i).begin() == 15);
	BOOST_CHECK((*i).end() == 35);
	BOOST_CHECK(r.size() == 2);

	// RC_BORDER_END
	BOOST_CHECK_NO_THROW(r.merge(RR(35, 37)));
	i = r.begin();
	BOOST_CHECK((*i).begin() == 3);
	BOOST_CHECK((*i).end() == 12);
	i++;
	BOOST_CHECK((*i).begin() == 15);
	BOOST_CHECK((*i).end() == 37);
	BOOST_CHECK(r.size() == 2);

	// Insert between the two existing ranges
	BOOST_CHECK_NO_THROW(r.merge(RR(13, 14)));
	i = r.begin();
	BOOST_CHECK((*i).begin() == 3);
	BOOST_CHECK((*i).end() == 37);
	BOOST_CHECK(r.size() == 1);

	/************************** PART II: Erasing *************************/
	// splitting existing range into two
	BOOST_CHECK_NO_THROW(r.erase(RR(10, 12)));

	i = r.begin();
	BOOST_CHECK((*i).begin() == 3);
	BOOST_CHECK((*i).end() == 9);
	i++;
	BOOST_CHECK((*i).begin() == 13);
	BOOST_CHECK((*i).end() == 37);
	BOOST_CHECK(r.size() == 2);

	// removing range that doesnt exist
//.........这里部分代码省略.........
开发者ID:alosarv,项目名称:hydranode,代码行数:101,代码来源:test-range.cpp

示例8: empty_set_types_variety_test

void empty_set_types_variety_test()
{
    BOOST_CHECK(!(has_key<Set, char>::value));
    BOOST_CHECK(!(has_key<Set, int>::value));
    BOOST_CHECK(!(has_key<Set, UDT>::value));
    BOOST_CHECK(!(has_key<Set, incomplete>::value));

    BOOST_CHECK(!(has_key<Set, char const>::value));
    BOOST_CHECK(!(has_key<Set, int const>::value));
    BOOST_CHECK(!(has_key<Set, UDT const>::value));
    BOOST_CHECK(!(has_key<Set, incomplete const>::value));

    BOOST_CHECK(!(has_key<Set, int *>::value));
    BOOST_CHECK(!(has_key<Set, UDT *>::value));
    BOOST_CHECK(!(has_key<Set, incomplete *>::value));

    BOOST_CHECK(!(has_key<Set, int &>::value));
    BOOST_CHECK(!(has_key<Set, UDT &>::value));
    BOOST_CHECK(!(has_key<Set, incomplete &>::value));
}
开发者ID:oakad,项目名称:ucpf,代码行数:20,代码来源:set.cpp

示例9: set_types_variety_test

void set_types_variety_test()
{
	BOOST_CHECK_EQUAL((size<Set>::value), 8);

	BOOST_CHECK((has_key<Set, char>::value));
	BOOST_CHECK((has_key<Set, int const>::value));
	BOOST_CHECK((has_key<Set, long *>::value));
	BOOST_CHECK((has_key<Set, UDT * const>::value));
	BOOST_CHECK((has_key<Set, incomplete>::value));
	BOOST_CHECK((has_key<Set, abstract>::value));
	BOOST_CHECK((has_key<Set, incomplete volatile &>::value));
	BOOST_CHECK((has_key<Set, abstract const &>::value));

	BOOST_CHECK(!(has_key<Set, char const>::value));
	BOOST_CHECK(!(has_key<Set, int>::value));
	BOOST_CHECK(!(has_key<Set, long * const>::value));
	BOOST_CHECK(!(has_key<Set, UDT *>::value));
	BOOST_CHECK(!(has_key<Set, incomplete const>::value));
	BOOST_CHECK(!(has_key<Set, abstract volatile>::value));
	BOOST_CHECK(!(has_key<Set, incomplete &>::value));
	BOOST_CHECK(!(has_key<Set, abstract &>::value));
}
开发者ID:oakad,项目名称:ucpf,代码行数:22,代码来源:set.cpp

示例10: test_one

void test_one ()
{
//  Note: The literal values here are tested against directly, careful if you change them:
    int some_numbers[] = { 1, 1, 2, 3, 5 };
    std::vector<int> vi(some_numbers, some_numbers + 5);
    std::list<int>   li(vi.begin(), vi.end ());
    
    int some_letters[] = { 'a', 'q', 'n', 'y', 'n' };
    std::vector<char> vc(some_letters, some_letters + 5);
    
    BOOST_CHECK (!ba::one_of_equal ( vi,                                  1 ));
    BOOST_CHECK (!ba::one_of       ( vi,                       is_<int> ( 1 )));
    BOOST_CHECK (!ba::one_of_equal ( vi.begin(),     vi.end(),            1 ));
    BOOST_CHECK (!ba::one_of       ( vi.begin(),     vi.end(), is_<int> ( 1 )));

    BOOST_CHECK (!ba::one_of_equal ( vi,                                  0 ));
    BOOST_CHECK (!ba::one_of       ( vi,                       is_<int> ( 0 )));
    BOOST_CHECK (!ba::one_of_equal ( vi.begin(),     vi.end(),            0 ));
    BOOST_CHECK (!ba::one_of       ( vi.begin(),     vi.end(), is_<int> ( 0 )));
    
    BOOST_CHECK ( ba::one_of_equal ( vi,                                  2 ));
    BOOST_CHECK ( ba::one_of       ( vi,                       is_<int> ( 2 )));
    BOOST_CHECK ( ba::one_of_equal ( vi.begin(),     vi.end(),            2 ));
    BOOST_CHECK ( ba::one_of       ( vi.begin(),     vi.end(), is_<int> ( 2 )));

//  Check for a match at the end
    BOOST_CHECK ( ba::one_of_equal ( vi,                                  5 ));
    BOOST_CHECK ( ba::one_of       ( vi,                       is_<int> ( 5 )));
    BOOST_CHECK ( ba::one_of_equal ( vi.begin(),     vi.end(),            5 ));
    BOOST_CHECK ( ba::one_of       ( vi.begin(),     vi.end(), is_<int> ( 5 )));

    BOOST_CHECK ( ba::one_of_equal ( vi.begin() + 1, vi.end(),            1 ));
    BOOST_CHECK ( ba::one_of       ( vi.begin() + 1, vi.end(), is_<int> ( 1 )));
    
    BOOST_CHECK ( ba::one_of_equal ( vc.begin() + 1, vc.begin() + 2,             'q' ));
    BOOST_CHECK ( ba::one_of       ( vc.begin() + 1, vc.begin() + 2, is_<char> ( 'q' )));

    BOOST_CHECK (!ba::one_of_equal ( vc, '!' ));
    BOOST_CHECK (!ba::one_of       ( vc, is_<char> ( '!' )));
    
    BOOST_CHECK (!ba::one_of_equal ( vc, 'n' ));
    BOOST_CHECK (!ba::one_of       ( vc, is_<char> ( 'n' )));

//  Empty range check
    BOOST_CHECK (!ba::one_of_equal ( vi.begin(), vi.begin(),   1 ));
    BOOST_CHECK (!ba::one_of_equal ( vc.begin(), vc.begin(), 'a' ));
    BOOST_CHECK (!ba::one_of       ( vi.begin(), vi.begin(), is_<int>  (   1 )));
    BOOST_CHECK (!ba::one_of       ( vc.begin(), vc.begin(), is_<char> ( 'a' )));
    
    BOOST_CHECK (!ba::one_of_equal ( li,                                  1 ));
    BOOST_CHECK (!ba::one_of       ( li,                       is_<int> ( 1 )));
    BOOST_CHECK (!ba::one_of_equal ( li.begin(),     li.end(),            1 ));
    BOOST_CHECK (!ba::one_of       ( li.begin(),     li.end(), is_<int> ( 1 )));
    
    std::list<int>::iterator l_iter = li.begin ();
    l_iter++; l_iter++; l_iter++;
    BOOST_CHECK (!ba::one_of_equal ( li.begin(), l_iter,            1 ));
    BOOST_CHECK (!ba::one_of       ( li.begin(), l_iter, is_<int> ( 1 )));
    BOOST_CHECK ( ba::one_of_equal ( li.begin(), l_iter,            2 ));
    BOOST_CHECK ( ba::one_of       ( li.begin(), l_iter, is_<int> ( 2 )));
    BOOST_CHECK (!ba::one_of_equal ( li.begin(), l_iter,            3 ));
    BOOST_CHECK (!ba::one_of       ( li.begin(), l_iter, is_<int> ( 3 )));

}
开发者ID:LancelotGHX,项目名称:Simula,代码行数:64,代码来源:one_of_test.cpp

示例11: test

void test()
{
    int *pi = 0;
    BOOST_CHECK(pi == NULLPTR);
}
开发者ID:fpelliccioni,项目名称:pstade,代码行数:5,代码来源:2006_03_25.cpp

示例12: TestBoolNotification

void TestBoolNotification(const i_property_write<bool> &,boost::optional<bool>,bool cnew)
  {
  BOOST_CHECK(cnew);
  TestBoolNotificationWorked = true;
  }
开发者ID:eldiener,项目名称:property,代码行数:5,代码来源:test_member_data_value.cpp

示例13: TestPointer

void TestPointer(p_member_data_value_class & tcl) 
  {
  
  /*
  
  Pointers can be assigned, incremented, decremented,
  and take part in simple arithmetic.
  
  */
  
  prop_member_data
    <
    int *,
    p_member_data_class,
    &p_member_data_class::p_pointer,
    notification_boost_function
    > 
  p_loc_pointer(pmd_gl_pointer,&p_gl_iarray[7]);
  
  prop_member_data
    <
    int *,
    p_member_data_class,
    &p_member_data_class::p_pointer_2
    > 
  p_loc_pointer2(pmd_gl_pointer,&p_gl_iarray[4]);
  
  BOOST_CHECK_EQUAL(*p_loc_pointer,7783);
  
  p_loc_pointer = &p_gl_iarray[6];
  
  BOOST_CHECK_EQUAL(*p_loc_pointer,230);
  BOOST_CHECK_EQUAL(p_loc_pointer - p_loc_pointer2,2);
  
  p_loc_pointer += 4;
  BOOST_CHECK_EQUAL(*p_loc_pointer,12);
  p_loc_pointer.fun = &TestPointerNotification;
  p_loc_pointer -= 2;
  BOOST_CHECK_EQUAL(*p_loc_pointer,22675);
  BOOST_CHECK(TestPointerNotificationWorked);
  
  p_gl_pointer_ntf = &gld_int;
  
  *p_gl_pointer_ntf = 489;
  BOOST_CHECK_EQUAL(*p_gl_pointer_ntf,489);
  
  p_member_data_value_class::p_st_pointer = &p_member_data_value_class::p_st_iarray[5];
  
  BOOST_CHECK_EQUAL(*p_member_data_value_class::p_st_pointer,53);
  ++p_member_data_value_class::p_st_pointer;
  BOOST_CHECK_EQUAL(*p_member_data_value_class::p_st_pointer,3456);
  BOOST_CHECK_EQUAL(*tcl.p_pointer,34);
  tcl.p_pointer -= 2;
  BOOST_CHECK_EQUAL(*tcl.p_pointer,13562);
  --tcl.p_pointer;
  BOOST_CHECK_EQUAL(*tcl.p_pointer,56);
  tcl.p_pointer += 11;
  BOOST_CHECK_EQUAL(*(tcl.p_pointer--),3452);
  BOOST_CHECK_EQUAL(*tcl.p_pointer,789);
  p_member_data_value_class::p_st_pointer -= 4;
  BOOST_CHECK_EQUAL(*(p_member_data_value_class::p_st_pointer++),5347);
  BOOST_CHECK_EQUAL(*p_member_data_value_class::p_st_pointer,369);
  
  }
开发者ID:eldiener,项目名称:property,代码行数:64,代码来源:test_member_data_value.cpp

示例14: TestInt

void TestInt(p_member_data_value_class & tcl) 
  {
  
  /*
  
  Integers can be tested with the full range of integer operations.
  
  */
  
  prop_member_data
    <
    int,
    p_member_data_class,
    &p_member_data_class::p_data_int,
    notification_boost_function
    > 
  p_loc_int(tcl.pmd_int,563);
  
  p_gl_int = 34662;
  
  BOOST_CHECK_EQUAL(p_gl_int,34662);
  
  p_member_data_value_class::p_st_int = 34;
  
  BOOST_CHECK_EQUAL(p_member_data_value_class::p_st_int,34);
  tcl.p_int = 44;
  tcl.p_int += 12;
  BOOST_CHECK_EQUAL(tcl.p_int,56);
  tcl.p_int -= 16;
  BOOST_CHECK_EQUAL(tcl.p_int,40);
  ++tcl.p_int;
  BOOST_CHECK_EQUAL(tcl.p_int,41);
  ++tcl.p_int;
  ++tcl.p_int;
  --tcl.p_int;
  BOOST_CHECK_EQUAL(tcl.p_int,42);
  tcl.p_int /= 3;
  BOOST_CHECK_EQUAL(tcl.p_int,14);
  tcl.p_int *= 5;
  BOOST_CHECK_EQUAL(tcl.p_int,70);
  
  int il1(p_loc_int++);
  BOOST_CHECK_EQUAL(il1,563);
  BOOST_CHECK_EQUAL(p_loc_int,564);
  p_loc_int >>= 2;
  BOOST_CHECK_EQUAL(p_loc_int,141);
  p_loc_int -= 81;
  p_loc_int <<= 3;
  BOOST_CHECK_EQUAL(p_loc_int,480);
  il1 = --p_loc_int;
  BOOST_CHECK_EQUAL(il1,479);
  p_loc_int -= 6;
  BOOST_CHECK_EQUAL(p_loc_int,473);
  p_loc_int |= 0x0da;
  BOOST_CHECK_EQUAL(p_loc_int,475);
  p_loc_int &= 0x076;
  BOOST_CHECK_EQUAL(p_loc_int,82);
  p_loc_int.fun = &TestIntegerNotification;
  p_loc_int = 23611;
  BOOST_CHECK(TestIntegerNotificationWorked);
  
  tcl.p_int ^= 57;
  
  }
开发者ID:eldiener,项目名称:property,代码行数:64,代码来源:test_member_data_value.cpp

示例15: CheckCompare

static void CheckCompare(const int64_t& num1, const int64_t& num2)
{
    const CBigNum bignum1(num1);
    const CBigNum bignum2(num2);
    const CScriptNum scriptnum1(num1);
    const CScriptNum scriptnum2(num2);

    BOOST_CHECK((bignum1 == bignum1) == (scriptnum1 == scriptnum1));
    BOOST_CHECK((bignum1 != bignum1) ==  (scriptnum1 != scriptnum1));
    BOOST_CHECK((bignum1 < bignum1) ==  (scriptnum1 < scriptnum1));
    BOOST_CHECK((bignum1 > bignum1) ==  (scriptnum1 > scriptnum1));
    BOOST_CHECK((bignum1 >= bignum1) ==  (scriptnum1 >= scriptnum1));
    BOOST_CHECK((bignum1 <= bignum1) ==  (scriptnum1 <= scriptnum1));

    BOOST_CHECK((bignum1 == bignum1) == (scriptnum1 == num1));
    BOOST_CHECK((bignum1 != bignum1) ==  (scriptnum1 != num1));
    BOOST_CHECK((bignum1 < bignum1) ==  (scriptnum1 < num1));
    BOOST_CHECK((bignum1 > bignum1) ==  (scriptnum1 > num1));
    BOOST_CHECK((bignum1 >= bignum1) ==  (scriptnum1 >= num1));
    BOOST_CHECK((bignum1 <= bignum1) ==  (scriptnum1 <= num1));

    BOOST_CHECK((bignum1 == bignum2) ==  (scriptnum1 == scriptnum2));
    BOOST_CHECK((bignum1 != bignum2) ==  (scriptnum1 != scriptnum2));
    BOOST_CHECK((bignum1 < bignum2) ==  (scriptnum1 < scriptnum2));
    BOOST_CHECK((bignum1 > bignum2) ==  (scriptnum1 > scriptnum2));
    BOOST_CHECK((bignum1 >= bignum2) ==  (scriptnum1 >= scriptnum2));
    BOOST_CHECK((bignum1 <= bignum2) ==  (scriptnum1 <= scriptnum2));

    BOOST_CHECK((bignum1 == bignum2) ==  (scriptnum1 == num2));
    BOOST_CHECK((bignum1 != bignum2) ==  (scriptnum1 != num2));
    BOOST_CHECK((bignum1 < bignum2) ==  (scriptnum1 < num2));
    BOOST_CHECK((bignum1 > bignum2) ==  (scriptnum1 > num2));
    BOOST_CHECK((bignum1 >= bignum2) ==  (scriptnum1 >= num2));
    BOOST_CHECK((bignum1 <= bignum2) ==  (scriptnum1 <= num2));
}
开发者ID:10by10pixel,项目名称:bitcoin,代码行数:35,代码来源:scriptnum_tests.cpp


注:本文中的BOOST_CHECK函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。