您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ BOOST_CHECK_MESSAGE函数代码示例

51自学网 2021-06-01 19:52:32
  C++
这篇教程C++ BOOST_CHECK_MESSAGE函数代码示例写得很实用,希望能帮到您。

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

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

示例1: load_exported

// save exported polymorphic classvoid load_exported(const char *testfile){    test_istream is(testfile, TEST_STREAM_FLAGS);    test_iarchive ia(is, TEST_ARCHIVE_FLAGS);    polymorphic_base *rb1 = NULL;    polymorphic_base *rb2 = NULL;    polymorphic_derived2 *rd21 = NULL;    // export will permit correct serialization    // through a pointer to a base class    ia >> BOOST_SERIALIZATION_NVP(rb1);    BOOST_CHECK_MESSAGE(        boost::serialization::type_info_implementation<polymorphic_derived1>            ::type::get_const_instance()        ==         * boost::serialization::type_info_implementation<polymorphic_base>            ::type::get_const_instance().get_derived_extended_type_info(*rb1),        "restored pointer b1 not of correct type"    );    ia >> BOOST_SERIALIZATION_NVP(rb2);    BOOST_CHECK_MESSAGE(        boost::serialization::type_info_implementation<polymorphic_derived2>            ::type::get_const_instance()        ==         * boost::serialization::type_info_implementation<polymorphic_base>            ::type::get_const_instance().get_derived_extended_type_info(*rb2),        "restored pointer b2 not of correct type"    );    ia >> BOOST_SERIALIZATION_NVP(rd21);    BOOST_CHECK_MESSAGE(        boost::serialization::type_info_implementation<polymorphic_derived2>            ::type::get_const_instance()        ==         * boost::serialization::type_info_implementation<polymorphic_derived2>            ::type::get_const_instance().get_derived_extended_type_info(*rd21),        "restored pointer d2 not of correct type"    );    delete rb1;    delete rb2;    delete rd21;}
开发者ID:Alexander--,项目名称:Wesnoth-1.8-for-Android,代码行数:43,


示例2: test_empty_input

void test_empty_input(){    Geometry geometry;    bg::model::polygon        <            typename bg::point_type<Geometry>::type        > hull;    bg::convex_hull(geometry, hull);    BOOST_CHECK_MESSAGE(bg::num_points(hull) == 0, "Output convex hull should be empty" );}
开发者ID:MarcelRaad,项目名称:geometry,代码行数:11,


示例3: check_invalid_params

static void check_invalid_params(const cJSON *response){	const cJSON *error = cJSON_GetObjectItem(response, "error");	cJSON *code = cJSON_GetObjectItem(error, "code");	if (code != NULL) {		BOOST_CHECK_MESSAGE(code->type == cJSON_Number, "error code is not a number!");		BOOST_CHECK_MESSAGE(code->valueint == INVALID_PARAMS_ERROR, "error code does not correspond to invalid params");	} else {		BOOST_FAIL("No code object!");	}	cJSON *message = cJSON_GetObjectItem(error, "message");	if (message != NULL) {		BOOST_CHECK_MESSAGE(message->type == cJSON_String, "message is not a string!");		BOOST_CHECK_MESSAGE(strcmp(message->valuestring, "Invalid params") == 0, "message is not set to /"Invalid params/"!");	} else {		BOOST_FAIL("No message object!");	}}
开发者ID:gatzka,项目名称:cjet,代码行数:20,


示例4: check_self_touches

void check_self_touches(Geometry const& geometry,                        std::string const& wkt,                        bool expected){    bool detected = bg::touches(geometry);    BOOST_CHECK_MESSAGE(detected == expected,        "touches: " << wkt        << " -> Expected: " << expected        << " detected: " << detected);}
开发者ID:OggYiu,项目名称:rag-engine,代码行数:11,


示例5: check_disjoint

void check_disjoint(std::string const& id,                    G1 const& g1,                    G2 const& g2,                    bool expected){    bool detected = bg::disjoint(g1, g2);    BOOST_CHECK_MESSAGE(detected == expected,        "disjoint: " << id        << " -> Expected: " << expected        << " detected: " << detected);}
开发者ID:Adikteev,项目名称:rtbkit-deps,代码行数:11,


示例6: BOOST_FIXTURE_TEST_CASE

BOOST_FIXTURE_TEST_CASE(delete_nonexisting_method, F){	const char path[] = "/foo/bar/";	cJSON *request = create_add(path);	cJSON *response = remove_element_from_peer(&owner_peer, request);	BOOST_REQUIRE_MESSAGE(response != NULL, "remove_element_from_peer() had no response!");	BOOST_CHECK_MESSAGE(response_is_error(response), "remove_element_from_peer() failed!");	cJSON_Delete(request);	cJSON_Delete(response);}
开发者ID:gatzka,项目名称:cjet,代码行数:11,


示例7: apply

    static inline bool apply(Geometry const& geometry,                             bool expected_result)    {        bool valid = ValidityTester::apply(geometry);        BOOST_CHECK_MESSAGE( valid == expected_result,            "Expected: " << expected_result            << " detected: " << valid            << " wkt: " << bg::wkt(geometry) );        return valid;    }
开发者ID:Adikteev,项目名称:rtbkit-deps,代码行数:11,


示例8: testDefaultValue

void testDefaultValue(database* db, bool timestampNull){    try    {        short tableid = 1;        table_ptr tb = openTable(db, tableid, TD_OPEN_NORMAL+TD_OPEN_MASK_MYSQL_NULL);        tb->setKeyNum(0);        tb->clearBuffer(table::defaultNull);        fields& fds = tb->fields();        if (timestampNull)        {            for (short i = 0 ;i < (short)fds.size(); ++i)            {                bool v = true;                int dv = 0;                if (i == 0 || i == 5 || i == 6) v = false;                BOOST_CHECK_MESSAGE(fds[i].isNull() == v, "testDefaultValue isNull field num = " << i);                if (i == 5) dv = -1;                                    if (i == 6) dv = -123456;                BOOST_CHECK_MESSAGE(fds[i].i() == dv, "testDefaultValue defaultValue field num = "                         << i << " " << fds[i].i());            }        }else        {            int dfs[13] = {0, 0, 0, 0, 0, -1, -123456, 0, 3, 0, 0, 1, 0};            for (short i = 1 ;i < (short)fds.size(); ++i)            {                BOOST_CHECK_MESSAGE(fds[i].isNull() == (dfs[i] == 0), "testDefaultValue isNull field num = " << i);                if ((dfs[i] < 0) || i == 12)                    BOOST_CHECK_MESSAGE(fds[i].i() == dfs[i], "testDefaultValue i() field num = " << i);                else if ((dfs[i]  < 3))                    BOOST_CHECK_MESSAGE(fds[i].i64() == 0, "testDefaultValue i64() field num = " << i);            }        }    }    catch (bzs::rtl::exception& e)    {        _tprintf(_T("Error ! %s/n"), (*getMsg(e)).c_str());    }}
开发者ID:bizstation,项目名称:transactd,代码行数:41,


示例9: test_circle

void test_circle(Geometry const& geometry, std::string const& wkt_geometry, bool expected){    circle_type circle(point_type(1.0, 1.0), 3.0);    bool detected = bg::disjoint(geometry, circle);    BOOST_CHECK_MESSAGE(detected == expected,        "disjoint: " << wkt_geometry        << " in circle (1,1) with radius 3"        << " -> Expected: " << expected        << " detected: " << detected);}
开发者ID:AlexMioMio,项目名称:boost,代码行数:12,


示例10: BOOST_CHECK_MESSAGE

 VersionBitsTester &TestStateSinceHeight(int height) {     for (int i = 0; i < CHECKERS; i++) {         if ((insecure_rand() & ((1 << i) - 1)) == 0) {             BOOST_CHECK_MESSAGE(                 checker[i].GetStateSinceHeightFor(                     vpblock.empty() ? nullptr : vpblock.back()) == height,                 strprintf("Test %i for StateSinceHeight", num));         }     }     num++;     return *this; }
开发者ID:CommerciumBlockchain,项目名称:Commercium_Deprecated,代码行数:12,


示例11: test_one

void test_one(std::string const& case_id, std::string const& wkt, bool expected){    Geometry geometry;    bg::read_wkt(wkt, geometry);    bg::correct(geometry);    bool detected = bg::is_convex(geometry);    BOOST_CHECK_MESSAGE(detected == expected,        "Not as expected, case: " << case_id            << " / expected: " << expected            << " / detected: " << detected);}
开发者ID:LancelotGHX,项目名称:Simula,代码行数:12,


示例12: test_empty_input

void test_empty_input(Geometry1 const& geometry1, Geometry2 const& geometry2){    try    {        bg::distance(geometry1, geometry2);    }    catch(bg::empty_input_exception const& )    {        return;    }    BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown" );}
开发者ID:OggYiu,项目名称:rag-engine,代码行数:12,


示例13: check_geometry

void check_geometry(Geometry& geometry, std::string const& wkt, std::string const& expected){    bg::reverse(geometry);    std::ostringstream out;    out << bg::wkt(geometry);    BOOST_CHECK_MESSAGE(out.str() == expected,        "reverse: " << wkt        << " expected " << expected        << " got " << out.str());}
开发者ID:Adikteev,项目名称:rtbkit-deps,代码行数:12,


示例14: checkClose

 void checkClose (const Distance_t& other) {   BOOST_CHECK_MESSAGE (fabs (d_ - other.d_ ) < 1e-5, "values d are " << d_ << " and " << other.d_);   BOOST_CHECK_MESSAGE (fabs (x0_ - other.x0_ ) < 1e-5, "values x0 are " << x0_ << " and " << other.x0_);   BOOST_CHECK_MESSAGE (fabs (y0_ - other.y0_ ) < 1e-5, "values y0 are " << y0_ << " and " << other.y0_);   BOOST_CHECK_MESSAGE (fabs (z0_ - other.z0_ ) < 1e-5, "values z0 are " << z0_ << " and " << other.z0_);   BOOST_CHECK_MESSAGE (fabs (x1_ - other.x1_ ) < 1e-5, "values x1 are " << x1_ << " and " << other.x1_);   BOOST_CHECK_MESSAGE (fabs (y1_ - other.y1_ ) < 1e-5, "values y1 are " << y1_ << " and " << other.y1_);   BOOST_CHECK_MESSAGE (fabs (z1_ - other.z1_ ) < 1e-5, "values z1 are " << z1_ << " and " << other.z1_); }
开发者ID:MaximilienNaveau,项目名称:pinocchio,代码行数:10,


示例15: test_empty_input

void test_empty_input(Geometry const& geometry){    try    {        bg::length(geometry);    }    catch(bg::empty_input_exception const& )    {        return;    }    BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown" );}
开发者ID:LocutusOfBorg,项目名称:poedit,代码行数:12,


示例16: test_main

int test_main(int, char *[]){	boost::posix_time::time_duration reciprocal_lambda;		double avg_race_time = estimate_avg_race_time();		/* 5.298 = 0.995 quantile of exponential distribution */	const boost::posix_time::time_duration timeout = boost::posix_time::microseconds((long)(5.298 * avg_race_time));		{		boost::atomic<unsigned int> value(0);				/* testing two different operations in this loop, therefore		enlarge timeout */		boost::posix_time::time_duration tmp(timeout * 2);				bool success = concurrent_runner::execute(			boost::bind(test_arithmetic<unsigned int, 0>, boost::ref(value), _1),			tmp		);				BOOST_CHECK_MESSAGE(success, "concurrent arithmetic");	}		{		boost::atomic<unsigned int> value(0);				/* testing three different operations in this loop, therefore		enlarge timeout */		boost::posix_time::time_duration tmp(timeout * 3);				bool success = concurrent_runner::execute(			boost::bind(test_bitops<unsigned int, 0>, boost::ref(value), _1),			tmp		);				BOOST_CHECK_MESSAGE(success, "concurrent bitops");	}	return 0;}
开发者ID:Ravenwater,项目名称:dfv-prototype,代码行数:40,


示例17: TestAES256CBC

void TestAES256CBC(const std::string &hexkey, const std::string &hexiv, bool pad, const std::string &hexin, const std::string &hexout){    std::vector<unsigned char> key = ParseHex(hexkey);    std::vector<unsigned char> iv = ParseHex(hexiv);    std::vector<unsigned char> in = ParseHex(hexin);    std::vector<unsigned char> correctout = ParseHex(hexout);    std::vector<unsigned char> realout(in.size() + AES_BLOCKSIZE);    // Encrypt the plaintext and verify that it equals the cipher    AES256CBCEncrypt enc(&key[0], &iv[0], pad);    int size = enc.Encrypt(&in[0], in.size(), &realout[0]);    realout.resize(size);    BOOST_CHECK(realout.size() == correctout.size());    BOOST_CHECK_MESSAGE(realout == correctout, HexStr(realout) + std::string(" != ") + hexout);    // Decrypt the cipher and verify that it equals the plaintext    std::vector<unsigned char> decrypted(correctout.size());    AES256CBCDecrypt dec(&key[0], &iv[0], pad);    size = dec.Decrypt(&correctout[0], correctout.size(), &decrypted[0]);    decrypted.resize(size);    BOOST_CHECK(decrypted.size() == in.size());    BOOST_CHECK_MESSAGE(decrypted == in, HexStr(decrypted) + std::string(" != ") + hexin);    // Encrypt and re-decrypt substrings of the plaintext and verify that they equal each-other    for(std::vector<unsigned char>::iterator i(in.begin()); i != in.end(); ++i)    {        std::vector<unsigned char> sub(i, in.end());        std::vector<unsigned char> subout(sub.size() + AES_BLOCKSIZE);        int size = enc.Encrypt(&sub[0], sub.size(), &subout[0]);        if (size != 0)        {            subout.resize(size);            std::vector<unsigned char> subdecrypted(subout.size());            size = dec.Decrypt(&subout[0], subout.size(), &subdecrypted[0]);            subdecrypted.resize(size);            BOOST_CHECK(decrypted.size() == in.size());            BOOST_CHECK_MESSAGE(subdecrypted == sub, HexStr(subdecrypted) + std::string(" != ") + HexStr(sub));        }    }}
开发者ID:thelonecrouton,项目名称:uniqredit,代码行数:40,


示例18: check_touches

void check_touches(Geometry1 const& geometry1,                   Geometry2 const& geometry2,                   std::string const& wkt1,                   std::string const& wkt2,                   bool expected){    bool detected = bg::touches(geometry1, geometry2);    BOOST_CHECK_MESSAGE(detected == expected,        "touches: " << wkt1        << " with " << wkt2        << " -> Expected: " << expected        << " detected: " << detected);    detected = bg::touches(geometry2, geometry1);    BOOST_CHECK_MESSAGE(detected == expected,        "touches: " << wkt2        << " with " << wkt1        << " -> Expected: " << expected        << " detected: " << detected);}
开发者ID:OggYiu,项目名称:rag-engine,代码行数:22,


示例19: test_self_intersects

void test_self_intersects(std::string const& wkt, bool expected){    Geometry geometry;    bg::read_wkt(wkt, geometry);    bool detected = bg::intersects(geometry);    BOOST_CHECK_MESSAGE(detected == expected,        "intersects: " << wkt        << " -> Expected: " << expected        << " detected: " << detected);}
开发者ID:peplopez,项目名称:El-Rayo-de-Zeus,代码行数:13,


示例20: testWRDefaultValue

void testWRDefaultValue(database* db, bool timestampNull){    try    {        activeTable tb(db, _T("nulltest"));        writableRecord& wr = tb.getWritableRecord();        wr.clear();        if (timestampNull)        {            for (short i = 0 ;i < (short)wr.size(); ++i)            {                bool v = true;                int dv = 0;                if (i == 0 || i == 5 || i == 6) v = false;                BOOST_CHECK_MESSAGE(wr[i].isNull() == v, "testWRDefaultValue isNull field num = " << i);                if (i == 5) dv = -1;                                    if (i == 6) dv = -123456;                BOOST_CHECK_MESSAGE(wr[i].i() == dv, "testWRDefaultValue defaultValue field num = "                         << i << " " << wr[i].i());            }        }else        {            int dfs[13] = {0, 0, 0, 0, 0, -1, -123456, 0, 3, 0, 0, 1, 0};            for (short i = 1 ;i < (short)wr.size(); ++i)            {                BOOST_CHECK_MESSAGE(wr[i].isNull() == (dfs[i] == 0), "testWRDefaultValue isNull field num = " << i);                if ((dfs[i] < 0))                    BOOST_CHECK_MESSAGE(wr[i].i() == dfs[i], "testWRDefaultValue isNull field num = " << i);                else if ((dfs[i]  < 3))                    BOOST_CHECK_MESSAGE(wr[i].i64() == 0, "testWRDefaultValue isNull field num = " << i);            }        }    }    catch (bzs::rtl::exception& e)    {        _tprintf(_T("Error ! %s/n"), (*getMsg(e)).c_str());    }}
开发者ID:bizstation,项目名称:transactd,代码行数:39,


示例21: test_swapper

void test_swapper(ValueType original, CompareType result){	typedef util::endian::swappers::byte_swapper<ValueType> swapper;	BOOST_CHECK_EQUAL(sizeof(ValueType), sizeof(CompareType));	/*	 * test swapper interface	 */	ValueType original_copy = original;	swapper::swap_inplace(original_copy);	BOOST_CHECK_MESSAGE(!std::memcmp(&original_copy, &result, sizeof(ValueType)),		"  result: " << std::hex << result << " original_copy: " << std::hex << original_copy);	original_copy = original;	CompareType swapped = swapper::swap(original_copy);	BOOST_CHECK_EQUAL(result, swapped);	/*	 * test public interface	 */	original_copy = original;	util::endian::byte_swap_inplace(original_copy);	BOOST_CHECK_MESSAGE(!std::memcmp(&original_copy, &result, sizeof(ValueType)),		"  result: " << std::hex << result << " original_copy: " << std::hex << original_copy);	original_copy = original;	swapped = util::endian::byte_swap(original_copy);	BOOST_CHECK_EQUAL(result, swapped);	BOOST_CHECK_MESSAGE(!std::memcmp(&result, &swapped, sizeof(ValueType)),		"  result: " << std::hex << result << " swapped: " << std::hex << swapped << " original_copy: " << std::hex << original_copy);}
开发者ID:mauve,项目名称:util,代码行数:38,


示例22: test_centroid_exception

void test_centroid_exception(){    Geometry geometry;    try    {        typename bg::point_type<Geometry>::type c;        bg::centroid(geometry, c);    }    catch(bg::centroid_exception const& )    {        return;    }    BOOST_CHECK_MESSAGE(false, "A centroid_exception should have been thrown" );}
开发者ID:Ding8222,项目名称:abelkhan,代码行数:14,


示例23: test_insert_unknown_type

		void test_insert_unknown_type()		{			BOOST_TEST_MESSAGE("Inserting file with unknown file type");			Archive::EntryPtr epb = this->findFile(0);			// Insert a file with a numeric typecode ("unknown/doofus-1234")			Archive::EntryPtr ep =				this->pArchive->insert(epb, "", 0x0f, "unknown/doofus-1234", EA_NONE);			BOOST_CHECK_MESSAGE(				this->is_content_equal(this->insert_unknown_type()),				"Inserting file with known type wrote wrong filetype code"			);			BOOST_CHECK_MESSAGE(				this->is_supp_equal(camoto::SuppItem::FAT,					boost::static_pointer_cast<test_suppfat_gd_doofus>(						this->suppResult[camoto::SuppItem::FAT]					)->insert_unknown_type()),				"[SuppItem::FAT] Inserting file with known type wrote wrong filetype code"			);		}
开发者ID:HendrikR,项目名称:libgamearchive,代码行数:23,


示例24: check_geometry

void check_geometry(Geometry1 const& geometry1,                    Geometry2 const& geometry2,                    std::string const& wkt1,                    std::string const& wkt2,                    bool expected){    bool detected = bg::covered_by(geometry1, geometry2);    BOOST_CHECK_MESSAGE(detected == expected,                        "covered_by: " << wkt1                        << " in " << wkt2                        << " -> Expected: " << expected                        << " detected: " << detected);}
开发者ID:abhishekudupa,项目名称:boost-local,代码行数:14,


示例25: testAutoNotNull

void testAutoNotNull(database* db){    activeTable tb(db, _T("nulltest"));    writableRecord& wr = tb.getWritableRecord();    wr.clear();            wr[(short)0] = 3;    for (short i = 1 ;i < (short)wr.size(); ++i)    {        wr[i].setNull(true);        wr[i] = 1;// setNotNull automaticaly        BOOST_CHECK_MESSAGE(wr[i].isNull() == false, "testAutoNotNull isNull field num = " << i);    }}
开发者ID:bizstation,项目名称:transactd,代码行数:14,


示例26: check

void check(const RDPOrderType & cmd, const RDPOrderType & expected_cmd,           const char * message){    char buffer[2048];    size_t idx = 0;    idx += snprintf(buffer + idx,   1024 - idx, "%s:/n", message);    idx += snprintf(buffer + idx,   1024 - idx, "Expected ");    idx += expected_cmd.str(buffer + idx, 1024 - idx);    idx += snprintf(buffer + idx,   1024 - idx, "/nGot ");    idx += cmd.str(buffer + idx, 1024 - idx);    buffer[1023] = 0;    BOOST_CHECK_MESSAGE(expected_cmd == cmd, buffer);}
开发者ID:cuzz,项目名称:redemption,代码行数:14,


示例27: test_sha512_file_cross_memory

/* * Calls multiple times sha512_file(), sha512_file_ctx(), sha512_buffer() with * random offset & count parameters. Checks that all hash functions return identical * hash values. */static void test_sha512_file_cross_memory(){	const size_t file_size = 2 * 32768; // 2 * BLOCKSIZE	int fd = create_file(file_size);	BOOST_CHECK_MESSAGE(fd >= 0, "could not create temporary file");	const size_t num_iter = 1000;	char hash_file[64], hash_file_ctx[64], hash_memory[64];	struct sha512_ctx ctx;	std::unique_ptr<char[]> buffer(new char[file_size]);	int err;	for (size_t i = 0; i < num_iter; ++i) {		const off_t offset = rand() % file_size;		const size_t count = rand() % file_size;		sha512_init_ctx(&ctx);		err = sha512_file_ctx(fd, offset, count, &ctx);		if (offset + count > file_size) {			BOOST_CHECK_MESSAGE(err == -ESPIPE,				"sha512_file_ctx() must return ESPIPE when offset + count > file_size");		} else {			BOOST_CHECK_MESSAGE(err == 0,				"Unexpected error during sha512_file_ctx() call");		}		sha512_finish_ctx(&ctx, hash_file_ctx);		err = sha512_file(fd, offset, count, hash_file);		if (offset + count > file_size) {			BOOST_CHECK_MESSAGE(err == -ESPIPE,				"sha512_file() must return ESPIPE when offset + count > file_size");			continue;		} else {			BOOST_CHECK_MESSAGE(err == 0,				"Unexpected error during sha512_file() call");		}		err = pread(fd, buffer.get(), count, offset);		BOOST_CHECK_MESSAGE(err == static_cast<int>(count), "pread() failed, could not read test file");		sha512_buffer(buffer.get(), count, hash_memory);		BOOST_CHECK_MESSAGE(memcmp(hash_file, hash_memory, sizeof(hash_file)) == 0,			"hash_file != hash_memory: sha512_file() or sha512_buffer() function is broken");		BOOST_CHECK_MESSAGE(memcmp(hash_file_ctx, hash_memory, sizeof(hash_file)) == 0,			"hash_file_ctx != hash_memory: sha512_file_ctx() function is broken");	}}
开发者ID:abudnik,项目名称:elliptics,代码行数:52,


示例28: TestPassphraseSingle

static void TestPassphraseSingle(const std::vector<unsigned char>& vchSalt, const SecureString& passphrase, uint32_t rounds,                 const std::vector<unsigned char>& correctKey = std::vector<unsigned char>(),                 const std::vector<unsigned char>& correctIV=std::vector<unsigned char>()){    unsigned char chKey[WALLET_CRYPTO_KEY_SIZE];    unsigned char chIV[WALLET_CRYPTO_IV_SIZE];    CCrypter crypt;    crypt.SetKeyFromPassphrase(passphrase, vchSalt, rounds, 0);    OldSetKeyFromPassphrase(passphrase, vchSalt, rounds, 0, chKey, chIV);    BOOST_CHECK_MESSAGE(memcmp(chKey, crypt.vchKey.data(), crypt.vchKey.size()) == 0, /        HexStr(chKey, chKey+sizeof(chKey)) + std::string(" != ") + HexStr(crypt.vchKey));    BOOST_CHECK_MESSAGE(memcmp(chIV, crypt.vchIV.data(), crypt.vchIV.size()) == 0, /        HexStr(chIV, chIV+sizeof(chIV)) + std::string(" != ") + HexStr(crypt.vchIV));    if(!correctKey.empty())        BOOST_CHECK_MESSAGE(memcmp(chKey, &correctKey[0], sizeof(chKey)) == 0, /            HexStr(chKey, chKey+sizeof(chKey)) + std::string(" != ") + HexStr(correctKey.begin(), correctKey.end()));    if(!correctIV.empty())        BOOST_CHECK_MESSAGE(memcmp(chIV, &correctIV[0], sizeof(chIV)) == 0,            HexStr(chIV, chIV+sizeof(chIV)) + std::string(" != ") + HexStr(correctIV.begin(), correctIV.end()));}
开发者ID:brianmcmichael,项目名称:bitcoin,代码行数:24,



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


C++ BOOST_CHECK_THROW函数代码示例
C++ BOOST_CHECK_CLOSE函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。