本文整理汇总了C++中END_TEST函数的典型用法代码示例。如果您正苦于以下问题:C++ END_TEST函数的具体用法?C++ END_TEST怎么用?C++ END_TEST使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了END_TEST函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: test_aecp
bool test_aecp ( void )
{
bool r = false;
START_TEST();
END_TEST ( r );
return r;
}
开发者ID:eugenehp,项目名称:avdecc-pdu,代码行数:7,代码来源:avdecc-pdu_test_aecp.cpp
示例2: test_validate_fractional_miss
static void
test_validate_fractional_miss(void) {
START_TEST();
CHECK_TRUE(0 == cfg_schema_validate(db, false, false, &out),
"%s", abuf_getptr(&out));
cfg_db_add_entry(db, CFG_SEC, CFG_SECNAME, "fractional", "a");
CHECK_TRUE(0 != cfg_schema_validate(db, false, false, NULL),
"validation missed bad integer");
cfg_db_add_entry(db, CFG_SEC, CFG_SECNAME, "fractional", "3..4");
CHECK_TRUE(0 != cfg_schema_validate(db, false, false, NULL),
"validation missed bad integer");
cfg_db_add_entry(db, CFG_SEC, CFG_SECNAME, "fractional", "3.4.5");
CHECK_TRUE(0 != cfg_schema_validate(db, false, false, NULL),
"validation missed bad integer");
cfg_db_add_entry(db, CFG_SEC, CFG_SECNAME, "fractional", "0");
CHECK_TRUE(0 == cfg_schema_validate(db, false, false, NULL),
"validation had a false positive");
END_TEST();
}
开发者ID:benpicco,项目名称:oonf_api,代码行数:25,代码来源:test_config_validation.c
示例3: main
int main(int argc, char **argv)
{
struct s2n_connection *conn;
uint8_t mac_key[] = "sample mac key";
uint8_t aes128_key[] = "123456789012345";
struct s2n_blob aes128 = {.data = aes128_key,.size = sizeof(aes128_key) };
uint8_t random_data[S2N_LARGE_RECORD_LENGTH + 1];
struct s2n_blob r = {.data = random_data, .size = sizeof(random_data)};
BEGIN_TEST();
EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_SERVER));
EXPECT_SUCCESS(s2n_get_urandom_data(&r));
/* Peer and we are in sync */
conn->server = &conn->secure;
conn->client = &conn->secure;
/* test the AES128 cipher with a SHA1 hash */
conn->secure.cipher_suite->cipher = &s2n_aes128;
conn->secure.cipher_suite->hmac_alg = S2N_HMAC_SHA1;
EXPECT_SUCCESS(conn->secure.cipher_suite->cipher->get_encryption_key(&conn->secure.server_key, &aes128));
EXPECT_SUCCESS(conn->secure.cipher_suite->cipher->get_decryption_key(&conn->secure.client_key, &aes128));
EXPECT_SUCCESS(s2n_hmac_init(&conn->secure.client_record_mac, S2N_HMAC_SHA1, mac_key, sizeof(mac_key)));
EXPECT_SUCCESS(s2n_hmac_init(&conn->secure.server_record_mac, S2N_HMAC_SHA1, mac_key, sizeof(mac_key)));
conn->actual_protocol_version = S2N_TLS11;
/* Align the record size, then subtract 20 bytes for the HMAC, 16 bytes for the explicit IV, and one byte
* for the padding length byte.
*/
int small_aligned_payload = S2N_SMALL_FRAGMENT_LENGTH - (S2N_SMALL_FRAGMENT_LENGTH % 16) - 20 - 16 - 1;
int large_aligned_payload = S2N_LARGE_FRAGMENT_LENGTH - (S2N_LARGE_FRAGMENT_LENGTH % 16) - 20 - 16 - 1;
int bytes_written;
/* Check the default: small record */
EXPECT_SUCCESS(s2n_stuffer_wipe(&conn->out));
EXPECT_SUCCESS(bytes_written = s2n_record_write(conn, TLS_APPLICATION_DATA, &r));
EXPECT_EQUAL(bytes_written, small_aligned_payload);
/* Check explicitly small records */
EXPECT_SUCCESS(s2n_connection_prefer_low_latency(conn));
EXPECT_SUCCESS(s2n_stuffer_wipe(&conn->out));
EXPECT_SUCCESS(bytes_written = s2n_record_write(conn, TLS_APPLICATION_DATA, &r));
EXPECT_EQUAL(bytes_written, small_aligned_payload);
/* Check explicitly large records */
EXPECT_SUCCESS(s2n_connection_prefer_throughput(conn));
EXPECT_SUCCESS(s2n_stuffer_wipe(&conn->out));
EXPECT_SUCCESS(bytes_written = s2n_record_write(conn, TLS_APPLICATION_DATA, &r));
EXPECT_EQUAL(bytes_written, large_aligned_payload);
/* Clean up */
EXPECT_SUCCESS(conn->secure.cipher_suite->cipher->destroy_key(&conn->secure.server_key));
EXPECT_SUCCESS(conn->secure.cipher_suite->cipher->destroy_key(&conn->secure.client_key));
EXPECT_SUCCESS(s2n_connection_free(conn));
EXPECT_SUCCESS(s2n_hmac_init(&conn->secure.server_record_mac, S2N_HMAC_SHA1, mac_key, sizeof(mac_key)));
END_TEST();
}
开发者ID:Independent-Scientist,项目名称:s2n,代码行数:60,代码来源:s2n_record_size_test.c
示例4: test_netaddr_is_in_subnet
static void
test_netaddr_is_in_subnet(void) {
struct netaddr_str str1, str2;
size_t a, s;
START_TEST();
for (s = 0; s < sizeof(in_subnet_subnets) / sizeof(*in_subnet_subnets); s++) {
for (a = 0; a < sizeof(in_subnet_addrs) / sizeof(*in_subnet_addrs); a++) {
CHECK_TRUE(
in_subnet_results[a][s] == netaddr_binary_is_in_subnet(&in_subnet_subnets[s], &in_subnet_addrs[a],
netaddr_get_maxprefix(&in_subnet_addrs[a])/8, in_subnet_addrs[a]._type),
"%s should %sbe in %s",
netaddr_to_string(&str1, &in_subnet_addrs[a]),
in_subnet_results[a][s] ? "" : "not ",
netaddr_to_string(&str2, &in_subnet_subnets[s]));
CHECK_TRUE(
in_subnet_results[a][s] == netaddr_is_in_subnet(&in_subnet_subnets[s], &in_subnet_addrs[a]),
"%s should %sbe in %s",
netaddr_to_string(&str1, &in_subnet_addrs[a]),
in_subnet_results[a][s] ? "" : "not ",
netaddr_to_string(&str2, &in_subnet_subnets[s]));
}
}
END_TEST();
}
开发者ID:benpicco,项目名称:oonf_api,代码行数:27,代码来源:test_common_netaddr.c
示例5: main
int main(int argc, char **argv)
{
struct s2n_stuffer dhparams_in, dhparams_out;
struct s2n_dh_params dh_params;
struct s2n_blob b;
BEGIN_TEST();
EXPECT_EQUAL(s2n_get_private_random_bytes_used(), 0);
/* Parse the DH params */
b.data = dhparams;
b.size = sizeof(dhparams);
EXPECT_SUCCESS(s2n_stuffer_alloc(&dhparams_in, sizeof(dhparams)));
EXPECT_SUCCESS(s2n_stuffer_alloc(&dhparams_out, sizeof(dhparams)));
EXPECT_SUCCESS(s2n_stuffer_write(&dhparams_in, &b));
EXPECT_SUCCESS(s2n_stuffer_dhparams_from_pem(&dhparams_in, &dhparams_out));
b.size = s2n_stuffer_data_available(&dhparams_out);
b.data = s2n_stuffer_raw_read(&dhparams_out, b.size);
EXPECT_SUCCESS(s2n_pkcs3_to_dh_params(&dh_params, &b));
EXPECT_SUCCESS(s2n_dh_generate_ephemeral_key(&dh_params));
/* Verify that our DRBG is called and that over-riding works */
EXPECT_NOT_EQUAL(s2n_get_private_random_bytes_used(), 0);
EXPECT_SUCCESS(s2n_dh_params_free(&dh_params));
EXPECT_SUCCESS(s2n_stuffer_free(&dhparams_out));
EXPECT_SUCCESS(s2n_stuffer_free(&dhparams_in));
END_TEST();
}
开发者ID:Gorelli,项目名称:s2n,代码行数:32,代码来源:s2n_override_openssl_random_test.c
示例6: test_validate_fractional_minmax_miss
static void
test_validate_fractional_minmax_miss(void) {
START_TEST();
CHECK_TRUE(0 == cfg_schema_validate(db, false, false, &out),
"%s", abuf_getptr(&out));
cfg_db_add_entry(db, CFG_SEC, CFG_SECNAME, "fractional_minmax", "10.0001");
CHECK_TRUE(0 != cfg_schema_validate(db, false, false, &out),
"validation missed int out of range");
cfg_db_add_entry(db, CFG_SEC, CFG_SECNAME, "fractional_minmax", "10.0000");
CHECK_TRUE(0 == cfg_schema_validate(db, false, false, &out),
"validation had false positive (border case)");
cfg_db_add_entry(db, CFG_SEC, CFG_SECNAME, "fractional_minmax", "9.9999");
CHECK_TRUE(0 == cfg_schema_validate(db, false, false, &out),
"validation had false positive inside valid interval");
cfg_db_add_entry(db, CFG_SEC, CFG_SECNAME, "fractional_minmax", "-10.0001");
CHECK_TRUE(0 != cfg_schema_validate(db, false, false, &out),
"validation missed int out of range");
cfg_db_add_entry(db, CFG_SEC, CFG_SECNAME, "fractional_minmax", "-10.0000");
CHECK_TRUE(0 == cfg_schema_validate(db, false, false, &out),
"validation had false positive (border case)");
cfg_db_add_entry(db, CFG_SEC, CFG_SECNAME, "fractional_minmax", "-9.9999");
CHECK_TRUE(0 == cfg_schema_validate(db, false, false, &out),
"validation had false positive inside valid interval");
END_TEST();
}
开发者ID:benpicco,项目名称:oonf_api,代码行数:33,代码来源:test_config_validation.c
示例7: t02_several_add_methods
void t02_several_add_methods(){
INIT_TEST();
onion_block *block=onion_block_new();
FAIL_IF_EQUAL(block, NULL);
int i;
for (i=0;i<1024;i++){
onion_block_add_char(block, (char)i);
}
onion_block_clear(block);
onion_block_add_str(block, "first ");
for (i=0;i<1024;i++)
onion_block_add_str(block, "test ");
FAIL_IF_NOT_STRSTR(onion_block_data(block), "test");
for (i=0;i<1024;i++)
onion_block_add_data(block, "world", 4);
FAIL_IF_STRSTR(onion_block_data(block), "world");
FAIL_IF_NOT_STRSTR(onion_block_data(block), "worl");
int s=onion_block_size(block);
onion_block_add_block(block, block);
FAIL_IF_NOT_EQUAL(onion_block_size(block), s+s);
onion_block_free(block);
END_TEST();
}
开发者ID:cemonds,项目名称:onion,代码行数:34,代码来源:09-block.c
示例8: test_default_named_section_set
static void
test_default_named_section_set(void) {
const struct const_strarray *value;
START_TEST();
cfg_db_overwrite_entry(db, CFG_SECTION, CFG_SECTION_NAME, CFG_ENTRY_DEF, CFG_NAMED_VALUE);
cfg_db_overwrite_entry(db, CFG_SECTION, CFG_SECTION_NAME, CFG_ENTRY_NODEF, CFG_NAMED_VALUE);
value = cfg_db_get_entry_value(db, CFG_SECTION, CFG_SECTION_NAME, CFG_ENTRY_DEF);
CHECK_TRUE(value != NULL, "No value found for named section entry with default");
if (value) {
CHECK_TRUE(value->value != NULL && strcmp(value->value, CFG_NAMED_VALUE) == 0,
"Did not got the named_section value with default: %s", value->value);
}
value = cfg_db_get_entry_value(db, CFG_SECTION, CFG_SECTION_NAME, CFG_ENTRY_NODEF);
CHECK_TRUE(value != NULL, "No value found for named section entry without default");
if (value) {
CHECK_TRUE(value->value != NULL && strcmp(value->value, CFG_NAMED_VALUE) == 0,
"Did not got the named_section value without default: %s", value->value);
}
value = cfg_db_get_entry_value(db, CFG_SECTION, NULL, CFG_ENTRY_DEF);
CHECK_TRUE(value != NULL, "No value found for unnamed section entry with default");
if (value) {
CHECK_TRUE(value->value != NULL && strcmp(value->value, CFG_SCHEMA_DEFAULT) == 0,
"Did not got the named_section value with default: %s", value->value);
}
value = cfg_db_get_entry_value(db, CFG_SECTION, NULL, CFG_ENTRY_NODEF);
CHECK_TRUE(value == NULL, "value found for unnamed section entry without default: %s",
value == NULL ? "" : value->value);
END_TEST();
}
开发者ID:benpicco,项目名称:oonf_api,代码行数:34,代码来源:test_config_default.c
示例9: test_simple_list_fill
void test_simple_list_fill(struct test_list* _head) {
START_TEST();
CHECK_TRUE(_is_equal(_get_by_buffer(_head, bar), 42, bar), "%s", _print_result(_get_by_buffer(_head, bar)));
CHECK_TRUE(_is_equal(_get_by_value(_head, 23), 23, foo), "%s", _print_result(_get_by_value(_head, 23)));
END_TEST();
}
开发者ID:benpicco,项目名称:tiny_olsr2,代码行数:8,代码来源:test_list.c
示例10: test_validate_success
static void
test_validate_success(void) {
START_TEST();
CHECK_TRUE(0 == cfg_schema_validate(db, false, false, &out),
"%s", abuf_getptr(&out));
END_TEST();
}
开发者ID:benpicco,项目名称:oonf_api,代码行数:8,代码来源:test_config_validation.c
示例11: test_succeeds
void test_succeeds(PSMove *move) {
int i;
BEGIN_TEST("psmove_update_leds succeeds (rate limiting disabled)");
for (i=0; i<10; i++) {
psmove_set_leds(move, i, i, i);
assert(psmove_update_leds(move) == Update_Success);
}
END_TEST();
}
开发者ID:CarlKenner,项目名称:psmoveapi,代码行数:10,代码来源:test_led_update.c
示例12: test_str_to_isonumber_s64_2
static void
test_str_to_isonumber_s64_2(void) {
struct isonumber_str buf;
START_TEST();
CHECK_TRUE(
isonumber_from_s64(&buf,
5185050545986994176ll, "bit/s", 0, true, false) != NULL, "test");
END_TEST();
}
开发者ID:iamyangchen,项目名称:OONF,代码行数:10,代码来源:test_common_isonumber.c
示例13: START_TEST
void
FileOperationReadCacheTest::testOpenFile()
{
START_TEST(__func__);
CPPUNIT_ASSERT(pReadCacheManager!=NULL);
//CPPUNIT_ASSERT(pInterface!=NULL);
//CPPUNIT_ASSERT(pInterface->OpenFile(O_RDONLY));
END_TEST(__func__);
}
开发者ID:BDT-GER,项目名称:SWIFT-TLC,代码行数:10,代码来源:FileOperationReadCacheTest.cpp
示例14: test_simple_playback
static void
test_simple_playback (IFusionSoundBuffer *buffer)
{
BEGIN_TEST( "Simple Playback" );
TEST(playback->Start (playback, 0, 0));
TEST(playback->Wait (playback));
END_TEST();
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:11,代码来源:fs_advanced.c
示例15: main
int main(int argc, char* argv[])
{
PSMove *move = psmove_connect();
int i;
if (move == NULL) {
printf("Could not connect to default Move controller.\n"
"Please connect one via USB or Bluetooth.\n");
exit(1);
}
INFO("Rate limiting is disabled by default");
test_succeeds(move);
INFO("Enabling rate limiting");
psmove_set_rate_limiting(move, 1);
BEGIN_TEST("psmove_update_leds ignores updates (rate limiting enabled)");
for (i=0; i<10; i++) {
psmove_set_leds(move, i, i, i);
assert(psmove_update_leds(move) == Update_Ignored);
}
END_TEST();
INFO("Disabling rate limiting");
psmove_set_rate_limiting(move, 0);
BEGIN_TEST("psmove_update_leds ignores updates (unchanged values)");
psmove_set_leds(move, 1, 1, 1);
assert(psmove_update_leds(move) == Update_Success);
for (i=0; i<10; i++) {
assert(psmove_update_leds(move) == Update_Ignored);
}
END_TEST();
test_succeeds(move);
psmove_disconnect(move);
return 0;
}
开发者ID:CarlKenner,项目名称:psmoveapi,代码行数:41,代码来源:test_led_update.c
示例16: main
int main(int argc, char **argv)
{
unsigned char publicKey[BIKE1_L1_PUBLIC_KEY_BYTES];
unsigned char privateKey[BIKE1_L1_SECRET_KEY_BYTES];
unsigned char clientSharedSecretPlaintext[BIKE1_L1_SHARED_SECRET_BYTES];
unsigned char serverSharedSecretPlaintext[BIKE1_L1_SHARED_SECRET_BYTES];
unsigned char encryptedSecret[BIKE1_L1_CIPHERTEXT_BYTES];
BEGIN_TEST();
// BIKE is not supported in FIPS mode
if (s2n_is_in_fips_mode()) {
END_TEST();
}
EXPECT_SUCCESS(BIKE1_L1_crypto_kem_keypair(publicKey, privateKey));
EXPECT_SUCCESS(BIKE1_L1_crypto_kem_enc(encryptedSecret, clientSharedSecretPlaintext, publicKey));
EXPECT_SUCCESS(BIKE1_L1_crypto_kem_dec(serverSharedSecretPlaintext, encryptedSecret, privateKey));
EXPECT_BYTEARRAY_EQUAL(serverSharedSecretPlaintext, clientSharedSecretPlaintext, BIKE1_L1_SHARED_SECRET_BYTES);
END_TEST();
}
开发者ID:awslabs,项目名称:s2n,代码行数:21,代码来源:s2n_bike_test.c
示例17: test_simple_list_remove
void test_simple_list_remove(struct test_list** __head) {
struct test_list* _head;
simple_list_remove(__head, _get_by_buffer(*__head, foo));
_head = *__head;
START_TEST();
CHECK_TRUE(_is_equal(_head, 42, bar), "%s", _print_result(_head));
CHECK_TRUE(_is_equal(_head->next, 1337, baz), "%s", _print_result(_head->next));
END_TEST();
}
开发者ID:benpicco,项目名称:tiny_olsr2,代码行数:12,代码来源:test_list.c
示例18: test_validate_stringarray_miss
static void
test_validate_stringarray_miss(void) {
START_TEST();
CHECK_TRUE(0 == cfg_schema_validate(db, false, false, &out),
"%s", abuf_getptr(&out));
cfg_db_add_entry(db, CFG_SEC, CFG_SECNAME, "stringarray", "12345678");
CHECK_TRUE(0 != cfg_schema_validate(db, false, false, NULL),
"validation missed too long string value");
END_TEST();
}
开发者ID:benpicco,项目名称:oonf_api,代码行数:12,代码来源:test_config_validation.c
示例19: test_validate_printable_miss
static void
test_validate_printable_miss(void) {
START_TEST();
CHECK_TRUE(0 == cfg_schema_validate(db, false, false, &out),
"%s", abuf_getptr(&out));
cfg_db_add_entry(db, CFG_SEC, CFG_SECNAME, "printable", "1234\n5678");
CHECK_TRUE(0 != cfg_schema_validate(db, false, false, NULL),
"validation missed non-printable character");
END_TEST();
}
开发者ID:benpicco,项目名称:oonf_api,代码行数:12,代码来源:test_config_validation.c
示例20: test_simple_list_find
void test_simple_list_find(struct test_list* _head) {
char buffer[sizeof bar];
memcpy(buffer, bar, sizeof buffer);
START_TEST();
CHECK_TRUE(_is_equal(simple_list_find_memcmp(_head, buffer), 42, bar), "%s", _print_result(simple_list_find_memcmp(_head, buffer)));
CHECK_TRUE(_is_equal(simple_list_find_cmp(_head, buffer, (int (*)(void *, void *)) strcmp), 42, bar),
"%s", _print_result(simple_list_find_cmp(_head, buffer, (int (*)(void *, void *)) strcmp)));
END_TEST();
}
开发者ID:benpicco,项目名称:tiny_olsr2,代码行数:13,代码来源:test_list.c
注:本文中的END_TEST函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论