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


C++ EXPECT_TRUE函数代码示例

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


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

示例1: EXPECT_TRUE

void ManualPoller::poll_write(int, int evtfd, void* data)
{
    EXPECT_TRUE(this->has_pollee(evtfd)) << evtfd << " in " << data;
    pollees[evtfd] = EV_HUP | EV_READ | EV_WRITE;
}
开发者ID:sdgdsffdsfff,项目名称:redis-cerberus,代码行数:5,代码来源:mock-poll.cpp

示例2: Exec

	static void Exec(void * params) {
		OrderParams* order_params = static_cast<OrderParams*>(params);
		g_exec_order++;
		EXPECT_TRUE(g_exec_order == order_params->total_ - order_params->put_order_);
	}
开发者ID:tangjie,项目名称:app,代码行数:5,代码来源:at_exit_manager_unittest.cpp

示例3: TEST

TEST(String, Informational) {
  EXPECT_TRUE(String().isNull());
  EXPECT_TRUE(!String("").isNull());
  EXPECT_TRUE(String().empty());
  EXPECT_TRUE(String("").empty());
  EXPECT_TRUE(!String("test").empty());
  EXPECT_TRUE(String().size() == 0);
  EXPECT_TRUE(String().length() == 0);
  EXPECT_TRUE(String("").size() == 0);
  EXPECT_TRUE(String("").length() == 0);
  EXPECT_TRUE(String("test").size() == 4);
  EXPECT_TRUE(String("test").length() == 4);
  EXPECT_TRUE(!String("2test").isNumeric());
  EXPECT_TRUE(!String("2test").isInteger());
  EXPECT_TRUE(!String("test").isNumeric());
  EXPECT_TRUE(!String("test").isInteger());
  EXPECT_TRUE(String("23").isNumeric());
  EXPECT_TRUE(String("23").isInteger());
  EXPECT_TRUE(String("23.3").isNumeric());
  EXPECT_TRUE(!String("23.3").isInteger());
}
开发者ID:DerPapst,项目名称:hhvm,代码行数:21,代码来源:test-string.cpp

示例4: invoke_recoding

inline void invoke_recoding(recoding_parameters param)
{
    // Common setting
    typename Encoder::factory encoder_factory(
        param.m_max_symbols, param.m_max_symbol_size);

    encoder_factory.set_symbols(param.m_symbols);
    encoder_factory.set_symbol_size(param.m_symbol_size);

    auto encoder = encoder_factory.build();

    typename Decoder::factory decoder_factory(
        param.m_max_symbols, param.m_max_symbol_size);

    decoder_factory.set_symbols(param.m_symbols);
    decoder_factory.set_symbol_size(param.m_symbol_size);

    auto decoder_one = decoder_factory.build();
    auto decoder_two = decoder_factory.build();

    // If tested with a shallow decoder we have to remember to set the
    // buffers to use for the decoding
    std::vector<uint8_t> buffer_decoder_one(decoder_one->block_size(), '\0');
    std::vector<uint8_t> buffer_decoder_two(decoder_two->block_size(), '\0');

    if(kodo::has_shallow_symbol_storage<Decoder>::value)
    {
        decoder_one->set_symbols(sak::storage(buffer_decoder_one));
        decoder_two->set_symbols(sak::storage(buffer_decoder_two));
    }

    EXPECT_EQ(encoder->payload_size(), decoder_one->payload_size());
    EXPECT_EQ(encoder->payload_size(), decoder_two->payload_size());

    std::vector<uint8_t> payload(encoder->payload_size());
    std::vector<uint8_t> data_in = random_vector(encoder->block_size());

    encoder->set_symbols(sak::storage(data_in));

    // Set the encoder non-systematic
    if(kodo::has_systematic_encoder<Encoder>::value)
        kodo::set_systematic_off(encoder);

    while( !decoder_two->is_complete() )
    {
        uint32_t encode_size = encoder->encode( &payload[0] );
        EXPECT_TRUE(encode_size <= payload.size());
        EXPECT_TRUE(encode_size > 0);

        decoder_one->decode( &payload[0] );

        uint32_t recode_size = decoder_one->recode( &payload[0] );
        EXPECT_TRUE(recode_size <= payload.size());
        EXPECT_TRUE(recode_size > 0);

        decoder_two->decode( &payload[0] );
    }

    std::vector<uint8_t> data_out_one(decoder_one->block_size(), '\0');
    std::vector<uint8_t> data_out_two(decoder_two->block_size(), '\0');

    decoder_one->copy_symbols(sak::storage(data_out_one));
    decoder_two->copy_symbols(sak::storage(data_out_two));

    EXPECT_TRUE(std::equal(data_out_one.begin(),
                           data_out_one.end(),
                           data_in.begin()));

    EXPECT_TRUE(std::equal(data_out_two.begin(),
                           data_out_two.end(),
                           data_in.begin()));
}
开发者ID:GOPRO1955,项目名称:kodo,代码行数:72,代码来源:helper_test_recoding_api.hpp

示例5: IntegerBasicTest

  void IntegerBasicTest()
  {
    Dissent::Crypto::Integer int0(5);
    Dissent::Crypto::Integer int1(6);

    EXPECT_NE(int0, int1);
    EXPECT_EQ(int0, int1 - 1);
    EXPECT_EQ(int0 + 1, int1);
    EXPECT_TRUE(int0 < int1);
    EXPECT_TRUE(int1 > int0);
    EXPECT_TRUE(int0 <= int1);
    EXPECT_TRUE(int1 >= int0);
    EXPECT_TRUE(int0 + 1 <= int1);
    EXPECT_TRUE(int1 - 1 >= int0);

    std::swap(int0, int1);

    EXPECT_NE(int0, int1);
    EXPECT_EQ(int0, int1 + 1);
    EXPECT_EQ(int0 - 1, int1);
    EXPECT_TRUE(int0 > int1);
    EXPECT_TRUE(int1 < int0);
    EXPECT_TRUE(int0 >= int1);
    EXPECT_TRUE(int1 <= int0);
    EXPECT_TRUE(int0 - 1 >= int1);
    EXPECT_TRUE(int1 + 1 <= int0);

    EXPECT_EQ(int0 * int1, Integer(30));
    EXPECT_EQ(Integer(30) / int0, int1);
    EXPECT_EQ(Integer(30) / int1, int0);
  }
开发者ID:ranzhao1,项目名称:Dissent-1,代码行数:31,代码来源:IntegerTest.cpp

示例6: TEST

TEST(stanMcmcDiagEStaticHmc,headerParses) {
  EXPECT_TRUE(true);
}
开发者ID:danstowell,项目名称:stan,代码行数:3,代码来源:stan_mcmc_diag_e_static_hmc_test.cpp

示例7: TEST_F

TEST_F(TimeSmokeTest, simpleAbsoluteTime)
{
    timeHandle = xme_hal_time_handleFromAbsoluteTime(&someTime);
    EXPECT_TRUE(xme_hal_time_isValidTimeHandle(timeHandle));
}
开发者ID:donal3000,项目名称:autopnp,代码行数:5,代码来源:smokeTestTime.cpp

示例8: TEST_F

TEST_F(SQLiteUtilTests, test_simple_query_execution) {
  // Access to the internal SQL implementation is only available in core.
  auto sql = SQL("SELECT * FROM time");
  EXPECT_TRUE(sql.ok());
  EXPECT_EQ(sql.rows().size(), 1U);
}
开发者ID:HoloHill,项目名称:osquery,代码行数:6,代码来源:sqlite_util_tests.cpp

示例9: resultTypeMustBe

 void resultTypeMustBe() {
   EXPECT_TRUE(_result.is<T>());
 }
开发者ID:1125384055,项目名称:libraries,代码行数:3,代码来源:JsonParser_Variant_Tests.cpp

示例10: TEST_F

TEST_F(NodeSmokeTest, initIteratorOnNonInitedNodeTableWithValidInterface)
{
    xme_core_directory_nodeRegistryController_nodeInterfaceIterator_t *iterator=NULL;
    EXPECT_EQ(XME_STATUS_NOT_FOUND, xme_core_directory_nodeRegistryController_initNodeInterfaceIterator((xme_core_node_nodeId_t)1, XME_COM_INTERFACE_ADDRESS_TYPE_IPV4, &iterator));
    EXPECT_TRUE(NULL==iterator);
}
开发者ID:donal3000,项目名称:autopnp,代码行数:6,代码来源:smokeTestNodeRegistryController.cpp

示例11: TEST

TEST(hash_trie, trivial) {
  HashTrie t;
  read_t a = str_to_read("A");
  read_t ab = str_to_read("AB");
  read_t abc = str_to_read("ABC");
  read_t abd = str_to_read("ABD");
  id_t i_a = 0;
  id_t i_abc = 2;
  id_t i_abd = 3;

  t.insert(abc, i_abc, 1);
  // [abc]
  t.print(cout);

  read_t r;
  id_t w;
  t.get_ith(abc, 0, w, r);
  EXPECT_EQ(i_abc, w);
  EXPECT_EQ(abc, r);

  t.insert(abc, i_abc, 1);
  // [abc, abc]
  t.get_ith(ab, 0, w, r);
  EXPECT_EQ(i_abc, w);
  EXPECT_EQ(abc, r);
  t.get_ith(ab, 1, w, r);
  EXPECT_EQ(i_abc, w);
  EXPECT_EQ(abc, r);

  t.insert(abd, i_abd, 1);
  // [abc, abc, abd]
  // Order for C and D is not defined
  read_t r1, r2, r3;
  id_t w1, w2, w3;
  t.get_ith(ab, 0, w1, r1);
  t.get_ith(ab, 1, w2, r2);
  t.get_ith(ab, 2, w3, r3);
  EXPECT_TRUE(
      (w1 == i_abc && w2 == i_abc && w3 == i_abd &&
       r1 == abc && r2 == abc && r3 == abd) ||
      (w1 == i_abd && w2 == i_abc && w3 == i_abc &&
       r1 == abd && r2 == abc && r3 == abc));

  t.print(cout);
  EXPECT_EQ(3u, t.count_total(ab));
  EXPECT_EQ(3u, t.count_total(a));
  EXPECT_EQ(1u, t.count_total(abd));


  t.insert(a, i_a, 1);
  // [a, abc, abc, abd]
  t.print(cout);
  t.get_ith(a, 0, w, r);
  EXPECT_EQ(i_a, w);
  EXPECT_EQ(a, r);

  t.get_ith(a, 1, w1, r1);
  t.get_ith(a, 2, w2, r2);
  t.get_ith(a, 3, w3, r3);

  EXPECT_TRUE(
      (w1 == i_abc && w2 == i_abc && w3 == i_abd &&
       r1 == abc && r2 == abc && r3 == abd) ||
      (w1 == i_abd && w2 == i_abc && w3 == i_abc &&
       r1 == abd && r2 == abc && r3 == abc));
}
开发者ID:unnonouno,项目名称:ppg,代码行数:66,代码来源:hash_trie_test.cpp

示例12: TEST_F

TEST_F(XmlFasadeTest, hello){
	EXPECT_TRUE(true);
}
开发者ID:FlatmateProject,项目名称:cplusplus,代码行数:3,代码来源:XMLfasade_test.cpp

示例13: TEST

TEST(KeyboardmasterUT, Test)
{
	EXPECT_TRUE(true);
}
开发者ID:kubatrt,项目名称:KeyboardMaster,代码行数:4,代码来源:keyboardmasterTests.cpp

示例14: TEST

TEST(MruCache, InitialEmpty) {
  TestCache c(kCacheCapacity);
  EXPECT_TRUE(c.GetMostRecentlyUsed() == NULL);
}
开发者ID:epowers,项目名称:arc,代码行数:4,代码来源:mru_cache_test.cpp

示例15: TEST

TEST(is_hdd, linux_os_root)
{
  std::string path = "/";
  EXPECT_TRUE(tools::is_hdd(path.c_str()) != boost::none);
}
开发者ID:anonimal,项目名称:bitmonero,代码行数:5,代码来源:is_hdd.cpp


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