本文整理汇总了C++中TEST_START函数的典型用法代码示例。如果您正苦于以下问题:C++ TEST_START函数的具体用法?C++ TEST_START怎么用?C++ TEST_START使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TEST_START函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vAllocate_Deallocate_basic
int vAllocate_Deallocate_basic()
{
TEST_START();
unsigned int BufSize = 1024*1024;
unsigned int BufAddr = (unsigned int)new unsigned char[BufSize];
unsigned int BufMVA;
///> --------------------2. allocate MVA
MTKM4UDrv CM4u;
CM4u.m4u_enable_m4u_func(M4U_CLNTMOD_RDMA);
// allocate MVA buffer for m4u module
CM4u.m4u_alloc_mva(M4U_CLNTMOD_RDMA, // Module ID
BufAddr, // buffer virtual start address
BufSize, // buffer size
0,
0,
&BufMVA); // return MVA address
M4UDBG(" after m4u_alloc_mva(), BufMVA=0x%x \r\n", BufMVA);
CM4u.m4u_dump_info(M4U_CLNTMOD_RDMA);
CM4u.m4u_dealloc_mva(M4U_CLNTMOD_RDMA, BufAddr, BufSize, BufMVA);
M4UDBG(" after m4u_dealloc_mva() \r\n");
CM4u.m4u_dump_info(M4U_CLNTMOD_RDMA);
TEST_END();
return 0;
}
示例2: main
int main()
{
TEST_SET_START("20060918101000NM","NM", "llrintf4");
// unsigned long i11 = 0x5efffffful; // 9223371487098961920
// unsigned long i12 = 0xdefffffful; //-9223371487098961920
// unsigned long i11 = 0x49fffffful; //2097151.875000
// unsigned long i12 = 0x4a7ffffful; //4194303.750000
// float x0 = hide_float(-FLT_MAX); // -Inf
// float x1 = hide_float(FLT_MAX); // Inf
float x2 = hide_float(0.0); // +0
float x3 = hide_float(-0.0); // -0
// float x4 = hide_float(NANF); // NaN -> NaN
float x5 = hide_float( 0.5);
float x6 = hide_float(-0.5);
float x7 = hide_float(-0.499999);
float x8 = hide_float( 0.499999);
float x9 = hide_float(-999999.5);
float x10 = hide_float( 999999.5);
// float x11 = hide_float(make_float(i11));
// float x12 = hide_float(make_float(i12));
float x11 = hide_float( 9223371487098961920.);
float x12 = hide_float(-9223371487098961920.);
float x13 = (0.0 - FLT_MIN);
float x14 = FLT_MIN;
float x15 = hide_float(-2097151.875000);
float x16 = hide_float(-4194303.750000);
float x17 = hide_float( 4194303.750000);
float x18 = hide_float( 2097151.875000);
vec_float4 x0_v = ((vec_float4){ x2, x3, x5, x6});
llroundf4_t r0_v = set_llrintf4_t(0, 0, 0, 0);
vec_float4 x1_v = ((vec_float4){ x7, x8, x9, x10});
llroundf4_t r1_v = set_llrintf4_t(0, 0, -999999, 999999);
vec_float4 x2_v = ((vec_float4){ x11, x12, x13, x14});
llroundf4_t r2_v = set_llrintf4_t(9223371487098961920ll, -9223371487098961920ll, 0, 0);
vec_float4 x3_v = ((vec_float4){ x15, x16, x17, x18});
llroundf4_t r3_v = set_llrintf4_t(-2097151, -4194303, 4194303, 2097151);
llroundf4_t res_v;
TEST_START("llrintf4");
res_v = llrintf4 (x0_v);
TEST_CHECK("20060918101001NM", allequal_llroundf4( res_v, r0_v ), 0);
res_v = llrintf4 (x1_v);
TEST_CHECK("20060918101002NM", allequal_llroundf4( res_v, r1_v ), 0);
res_v = llrintf4 (x2_v);
TEST_CHECK("20060918101003NM", allequal_llroundf4( res_v, r2_v ), 0);
res_v = llrintf4 (x3_v);
TEST_CHECK("20060918101004NM", allequal_llroundf4( res_v, r3_v ), 0);
TEST_SET_DONE();
TEST_EXIT();
}
示例3: test_s2k
void
test_s2k(void)
{
TEST_START("s2k");
static unsigned char salt[S2K_SALT_BYTES] = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 };
const char * pphrase = "ImGumbyAndYouAreNot";
static unsigned char expected_key1[AES128_KEY_BYTES] = {
0x0e, 0xa5, 0x00, 0x1c, 0xce, 0xad, 0x7e, 0xa8, 0xa0, 0x81, 0x38, 0xae, 0xaf, 0x4e, 0x28, 0xd5
};
unsigned char s2k_key1[AES128_KEY_BYTES];
compute_gpg_s2k_key(pphrase, sizeof(s2k_key1), salt, S2K_ITER_BYTE_COUNT, s2k_key1);
ASSERT_INT_EQ(memcmp(s2k_key1, expected_key1, sizeof(s2k_key1)), 0);
// Second test to handle the case where we need to run multiple hashes to generate enough bits
// Note that the first 16 bytes are the same as the previous test - this is to be expected, since the
// salt and passphrase are the same, so the first hash is executed identically.
static unsigned char expected_key2[48] = {
0x0e, 0xa5, 0x00, 0x1c, 0xce, 0xad, 0x7e, 0xa8, 0xa0, 0x81, 0x38, 0xae, 0xaf, 0x4e, 0x28, 0xd5,
0x21, 0xf1, 0xee, 0x4b, 0x02, 0xc0, 0x0f, 0x63, 0x6a, 0x17, 0xbf, 0x62, 0x34, 0x10, 0x26, 0x48,
0x7b, 0xc6, 0x3f, 0x08, 0x9d, 0xb5, 0x6b, 0x34, 0x70, 0x3b, 0x71, 0xdb, 0x67, 0x92, 0x6f, 0x5f
};
unsigned char s2k_key2[48];
compute_gpg_s2k_key(pphrase, sizeof(s2k_key2), salt, S2K_ITER_BYTE_COUNT, s2k_key2);
ASSERT_INT_EQ(memcmp(s2k_key2, expected_key2, sizeof(s2k_key2)), 0);
TEST_DONE();
}
示例4: main
int main(int argc, char *argv[])
{
TEST_START();
TEST(test_cat());
TEST_END();
return 0;
}
示例5: tests
void
tests(void)
{
char *loc;
TEST_START("utf8_setlocale");
loc = setlocale(LC_CTYPE, "en_US.UTF-8");
ASSERT_PTR_NE(loc, NULL);
TEST_DONE();
badarg();
one("null", NULL, 8, 6, 6, "(null)");
one("empty", "", 2, 0, 0, "");
one("ascii", "x", -2, -2, -2, "x");
one("newline", "a\nb", -2, -2, -2, "a\nb");
one("cr", "a\rb", -2, -2, -2, "a\rb");
one("tab", "a\tb", -2, -2, -2, "a\tb");
one("esc", "\033x", -2, -2, -2, "\\033x");
one("inv_badbyte", "\377x", -2, -2, -2, "\\377x");
one("inv_nocont", "\341x", -2, -2, -2, "\\341x");
one("inv_nolead", "a\200b", -2, -2, -2, "a\\200b");
one("sz_ascii", "1234567890123456", -2, -2, 16, "123456789012345");
one("sz_esc", "123456789012\033", -2, -2, 16, "123456789012");
one("width_ascii", "123", 2, 2, -1, "12");
one("width_double", "a\343\201\201", 2, 1, -1, "a");
one("double_fit", "a\343\201\201", 3, 3, 4, "a\343\201\201");
one("double_spc", "a\343\201\201", 4, 3, 4, "a\343\201\201");
}
示例6: main
int main(int argc, char *argv[])
{
TEST_START();
display = get_display();
/* get an appropriate EGL frame buffer configuration */
ECHK(eglChooseConfig(display, config_attribute_list, &config, 1, &num_config));
DEBUG_MSG("num_config: %d", num_config);
/* create an EGL rendering context */
ECHK(context = eglCreateContext(display, config, EGL_NO_CONTEXT, context_attribute_list));
TEST(test_tex(0, 0, 0));
TEST(test_tex(0, 1, 0));
TEST(test_tex(1, 0, 0));
TEST(test_tex(1, 1, 0));
TEST(test_tex(1, 2, 0));
TEST(test_tex(2, 1, 0));
TEST(test_tex(2, 2, 0));
TEST(test_tex(0, 3, 0));
TEST(test_tex(3, 2, 0));
TEST(test_tex(3, 0, 1));
TEST(test_tex(0, 3, 1));
TEST(test_tex(3, 3, 1));
TEST(test_tex(1, 2, 1));
TEST(test_tex(2, 1, 1));
ECHK(eglTerminate(display));
TEST_END();
return 0;
}
示例7: main
int main(int argc, char *argv[])
{
TEST_START();
TEST(test_quad_textured(0, 0));
TEST(test_quad_textured(0, 1));
TEST(test_quad_textured(0, 2));
TEST(test_quad_textured(0, 3));
TEST(test_quad_textured(0, 4));
TEST(test_quad_textured(0, 5));
TEST(test_quad_textured(0, 6));
TEST(test_quad_textured(0, 7));
TEST(test_quad_textured(0, 8));
TEST(test_quad_textured(0, 9));
TEST(test_quad_textured(1, GL_NEVER));
TEST(test_quad_textured(1, GL_LESS));
TEST(test_quad_textured(1, GL_EQUAL));
TEST(test_quad_textured(1, GL_LEQUAL));
TEST(test_quad_textured(1, GL_GREATER));
TEST(test_quad_textured(1, GL_NOTEQUAL));
TEST(test_quad_textured(1, GL_GEQUAL));
TEST(test_quad_textured(1, GL_ALWAYS));
TEST_END();
return 0;
}
示例8: test_db_single_get
static int test_db_single_get(T *db)
{
int r, ks, vs;
char *kdata, *vdp, *kdp;
kdata = MY_Malloc(l_ksize + 32);
TEST_START();
sprintf(kdata, "%s", l_prefix);
ks = strlen(kdata);
if (dbver == 1) {
#if 0
r = db_get(db, kdata, ks, &vdp, &vs, NULL);
#endif
} else {
r = HIDB2(db_get)(db, kdata, ks, &vdp, &vs, NULL);
}
if (r == 0) {
MY_Free(vdp);
WARN("vs=%d, v=%.*s", vs, vdp);
} else {
WARN("%s not found or error, r=%d", kdata, r);
}
TEST_FIN()
MY_Free(kdata);
return 0;
}
示例9: test_db_iter
static int test_db_iter(T *db)
{
int r, ks, vs, cnt = 0;
char *k, *v, *kt, *vt;
iter_t *it;
TEST_START();
if (dbver == 1) {
#if 0
it = db_create_it(db, 15);
#endif
} else {
it = HIDB2(db_create_it)(db, 15);
}
while (1) {
if (dbver == 1) {
#if 0
r = db_iter(it, &k, &ks, &v, &vs, NULL);
#endif
} else {
r = HIDB2(db_iter)(it, &k, &ks, &v, &vs, NULL);
}
if (r != 0) break;
kt = strchr(k, '-');
vt = strchr(v, '-');
if ((ks - (kt - k) != vs - (vt - v))) {
ERROR("ks=%d vs=%d %.*s %.*s", ks, vs, ks, k, vs, v);
goto _next;
}
if (memcmp(kt, vt, ks - (kt - k)) != 0) {
ERROR("ks=%d vs=%d %.*s %.*s", ks, vs, ks, k, vs, v);
goto _next;
}
WARN("ks=%d vs=%d %.*s %.*s", ks, vs, ks, k, vs, v);
_next:
cnt++;
MY_Free(k);
MY_Free(v);
}
if (dbver == 1) {
#if 0
db_destroy_it(it);
#endif
} else {
HIDB2(db_destroy_it)(it);
}
PRINT(stdout, "iterate cnt=%d", cnt);
TEST_FIN()
return 0;
}
示例10: main
int main(int argc, char **argv)
{
TEST_START();
TEST(test_multi());
TEST_END();
return 0;
}
示例11: main
int main(int argc, char *argv[])
{
TEST_START();
TEST(test_strip_smoothed(0));
TEST(test_strip_smoothed(1));
TEST_END();
return 0;
}
示例12: main
int main(int argc, char *argv[])
{
TEST_START();
TEST(test_triangle_smoothed(GL_CCW));
TEST(test_triangle_smoothed(GL_CW));
TEST_END();
return 0;
}
示例13: main
int main()
{
TEST_SET_START("20040928182549EJL","EJL", "sqrtf4");
unsigned int i3 = 0x742c4455;
unsigned int i3r = 0x59d20034;
unsigned int i4 = 0x75e7753f;
unsigned int i4r = 0x5aac1fb5;
unsigned int i5 = 0x4baa9e3c;
unsigned int i5r = 0x4593c7d8;
unsigned int i6 = 0x39344296;
unsigned int i6r = 0x3c56d14c;
unsigned int i7 = 0x68a586b0;
unsigned int i7r = 0x54118f09;
float x3 = hide_float(make_float(i3));
float x3r = hide_float(make_float(i3r));
float x4 = hide_float(make_float(i4));
float x4r = hide_float(make_float(i4r));
float x5 = hide_float(make_float(i5));
float x5r = hide_float(make_float(i5r));
float x6 = hide_float(make_float(i6));
float x6r = hide_float(make_float(i6r));
float x7 = hide_float(make_float(i7));
float x7r = hide_float(make_float(i7r));
vec_float4 x3_v = spu_splats(x3);
vec_float4 x3r_v = spu_splats(x3r);
vec_float4 x4_v = spu_splats(x4);
vec_float4 x4r_v = spu_splats(x4r);
vec_float4 x5_v = spu_splats(x5);
vec_float4 x5r_v = spu_splats(x5r);
vec_float4 x6_v = spu_splats(x6);
vec_float4 x6r_v = spu_splats(x6r);
vec_float4 x7_v = spu_splats(x7);
vec_float4 x7r_v = spu_splats(x7r);
vec_float4 res_v;
TEST_START("sqrtf4");
res_v = sqrtf4(x3_v);
TEST_CHECK("20040928182552EJL", allequal_ulps_float4( res_v, x3r_v, 2 ), 0);
res_v = sqrtf4(x4_v);
TEST_CHECK("20040928182554EJL", allequal_ulps_float4( res_v, x4r_v, 2 ), 0);
res_v = sqrtf4(x5_v);
TEST_CHECK("20040928182556EJL", allequal_ulps_float4( res_v, x5r_v, 2 ), 0);
res_v = sqrtf4(x6_v);
TEST_CHECK("20040928182557EJL", allequal_ulps_float4( res_v, x6r_v, 2 ), 0);
res_v = sqrtf4(x7_v);
TEST_CHECK("20040928182559EJL", allequal_ulps_float4( res_v, x7r_v, 2 ), 0);
TEST_SET_DONE();
TEST_EXIT();
}
示例14: main
int main()
{
TEST_SET_START("20040916145017EJL","EJL", "floorf");
unsigned int i3 = 0x4affffff; // 2^23 - 0.5, largest truncatable value.
unsigned int i3i = 0x4afffffe;
unsigned int i4 = 0x4b000000; // 2^23, no fractional part.
unsigned int i5 = 0xcf000001; // -2^31, one more large, and negative, value.
float x0 = hide_float(0.91825f);
float x0i = hide_float(0.0f);
float x1 = hide_float(-0.12958f);
float x1i = hide_float(-1.0f);
float x2 = hide_float(-79615.1875f);
float x2i = hide_float(-79616.0f);
float x3 = hide_float(make_float(i3));
float x3i = hide_float(make_float(i3i));
float x4 = hide_float(make_float(i4));
float x4i = hide_float(make_float(i4));
float x5 = hide_float(make_float(i5));
float x5i = hide_float(make_float(i5));
vec_float4 x0_v = vec_splat_float(x0);
vec_float4 x0i_v = vec_splat_float(x0i);
vec_float4 x1_v = vec_splat_float(x1);
vec_float4 x1i_v = vec_splat_float(x1i);
vec_float4 x2_v = vec_splat_float(x2);
vec_float4 x2i_v = vec_splat_float(x2i);
vec_float4 x3_v = vec_splat_float(x3);
vec_float4 x3i_v = vec_splat_float(x3i);
vec_float4 x4_v = vec_splat_float(x4);
vec_float4 x4i_v = vec_splat_float(x4i);
vec_float4 x5_v = vec_splat_float(x5);
vec_float4 x5i_v = vec_splat_float(x5i);
vec_float4 res_v;
TEST_START("floorf4");
res_v = floorf4(x0_v);
TEST_CHECK("20040916145022EJL", allequal_float4( res_v, x0i_v ), 0);
res_v = floorf4(x1_v);
TEST_CHECK("20040916145024EJL", allequal_float4( res_v, x1i_v ), 0);
res_v = floorf4(x2_v);
TEST_CHECK("20040916145027EJL", allequal_float4( res_v, x2i_v ), 0);
res_v = floorf4(x3_v);
TEST_CHECK("20040916145029EJL", allequal_float4( res_v, x3i_v ), 0);
res_v = floorf4(x4_v);
TEST_CHECK("20040916145032EJL", allequal_float4( res_v, x4i_v ), 0);
res_v = floorf4(x5_v);
TEST_CHECK("20040916145034EJL", allequal_float4( res_v, x5i_v ), 0);
TEST_SET_DONE();
TEST_EXIT();
}
示例15: main
int main()
{
TEST_SET_START("20040928182349EJL","EJL", "rsqrtf4");
unsigned int i3 = 0x742c4455;
unsigned int i3r = 0x251c099a;
unsigned int i4 = 0x75e7753f;
unsigned int i4r = 0x243e5fe2;
unsigned int i5 = 0x4baa9e3c;
unsigned int i5r = 0x395dbbeb;
unsigned int i6 = 0x39344296;
unsigned int i6r = 0x429889eb;
unsigned int i7 = 0x68a586b0;
unsigned int i7r = 0x2ae11e67;
float x3 = hide_float(make_float(i3));
float x3r = hide_float(make_float(i3r));
float x4 = hide_float(make_float(i4));
float x4r = hide_float(make_float(i4r));
float x5 = hide_float(make_float(i5));
float x5r = hide_float(make_float(i5r));
float x6 = hide_float(make_float(i6));
float x6r = hide_float(make_float(i6r));
float x7 = hide_float(make_float(i7));
float x7r = hide_float(make_float(i7r));
vec_float4 x3_v = spu_splats(x3);
vec_float4 x3r_v = spu_splats(x3r);
vec_float4 x4_v = spu_splats(x4);
vec_float4 x4r_v = spu_splats(x4r);
vec_float4 x5_v = spu_splats(x5);
vec_float4 x5r_v = spu_splats(x5r);
vec_float4 x6_v = spu_splats(x6);
vec_float4 x6r_v = spu_splats(x6r);
vec_float4 x7_v = spu_splats(x7);
vec_float4 x7r_v = spu_splats(x7r);
vec_float4 res_v;
TEST_START("rsqrtf4");
res_v = rsqrtf4(x3_v);
TEST_CHECK("20040928182352EJL", allequal_ulps_float4( res_v, x3r_v, 2 ), 0);
res_v = rsqrtf4(x4_v);
TEST_CHECK("20040928182355EJL", allequal_ulps_float4( res_v, x4r_v, 2 ), 0);
res_v = rsqrtf4(x5_v);
TEST_CHECK("20040928182357EJL", allequal_ulps_float4( res_v, x5r_v, 2 ), 0);
res_v = rsqrtf4(x6_v);
TEST_CHECK("20040928182358EJL", allequal_ulps_float4( res_v, x6r_v, 2 ), 0);
res_v = rsqrtf4(x7_v);
TEST_CHECK("20040928182401EJL", allequal_ulps_float4( res_v, x7r_v, 2 ), 0);
TEST_SET_DONE();
TEST_EXIT();
}