本文整理汇总了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;
}
示例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_);
}
示例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());
}
示例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()));
}
示例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);
}
示例6: TEST
TEST(stanMcmcDiagEStaticHmc,headerParses) {
EXPECT_TRUE(true);
}
示例7: TEST_F
TEST_F(TimeSmokeTest, simpleAbsoluteTime)
{
timeHandle = xme_hal_time_handleFromAbsoluteTime(&someTime);
EXPECT_TRUE(xme_hal_time_isValidTimeHandle(timeHandle));
}
示例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);
}
示例9: resultTypeMustBe
void resultTypeMustBe() {
EXPECT_TRUE(_result.is<T>());
}
示例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);
}
示例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));
}
示例12: TEST_F
TEST_F(XmlFasadeTest, hello){
EXPECT_TRUE(true);
}
示例13: TEST
TEST(KeyboardmasterUT, Test)
{
EXPECT_TRUE(true);
}
示例14: TEST
TEST(MruCache, InitialEmpty) {
TestCache c(kCacheCapacity);
EXPECT_TRUE(c.GetMostRecentlyUsed() == NULL);
}
示例15: TEST
TEST(is_hdd, linux_os_root)
{
std::string path = "/";
EXPECT_TRUE(tools::is_hdd(path.c_str()) != boost::none);
}