本文整理汇总了C++中set_test_name函数的典型用法代码示例。如果您正苦于以下问题:C++ set_test_name函数的具体用法?C++ set_test_name怎么用?C++ set_test_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_test_name函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: set_test_name
void test_group<test_data>::object::test<2>() {
set_test_name("Test adding valid key-pointers");
node.set_leftmost_pointer(0);
node.insert_key_in_order(100, 1);
node.insert_key_in_order(200, 2);
node.insert_key_in_order(50, 3);
ensure_equals(node.get_left_pointer_of(50), 0);
ensure_equals(node.get_right_pointer_of(50), 3);
ensure_equals(node.get_left_pointer_of(100), 3);
ensure_equals(node.get_right_pointer_of(100), 1);
ensure_equals(node.get_left_pointer_of(200), 1);
ensure_equals(node.get_right_pointer_of(200), 2);
}
开发者ID:andres-arana,项目名称:degree-7506-tp,代码行数:15,代码来源:inner_node_tests.cpp
示例2: set_test_name
void object::test<4>()
{
set_test_name("Javascript Test 3: window.setInterval()");
canvas->startWithCode("window.setInterval(function() { console.log(\"Hello, World!\"); });");
ensure(canvas->lastLogEntry() == "");
canvas->paint(0);
canvas->paint(0);
// After we have painter two times, we should have two "Hello, World!" messages in the history
ensure(canvas->lastLogEntry() == "Hello, World!");
ensure(canvas->lastLogEntry() == "Hello, World!");
ensure(canvas->lastLogEntry() == "");
}
开发者ID:caivega,项目名称:canvas-cpp,代码行数:15,代码来源:CanvasTest.cpp
示例3: set_test_name
void object::test<5>()
{
set_test_name("Test LLMediaEntry::asLLSD() -> LLMediaEntry::fromLLSD()");
LLMediaEntry entry1, entry2;
// Add a whitelist to entry2
std::vector<std::string> whitelist;
whitelist.push_back("*.example.com");
entry2.setWhiteList(whitelist);
// Render entry1 (which has no whitelist) as an LLSD
LLSD sd;
entry1.asLLSD(sd);
// "read" that LLSD into entry 2
entry2.fromLLSD(sd);
ensure_llsd_equals(get_test_name() + " failed", defaultMediaEntryLLSD, entry2.asLLSD());
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:15,代码来源:llmediaentry_test.cpp
示例4: set_test_name
void AsString_object::test<5>()
{
set_test_name("Equality test 3");
AsString_ref str1 = ASL("This is string");
AsString_ref str2 = AS_NULL;
AsString_ref str3 = AS_NULL;
bool succeed = true;
succeed = succeed && str1 != str2;
succeed = succeed && str2 != str1;
succeed = succeed && str2 == str3;
ensure(succeed);
}
开发者ID:weeeBox,项目名称:oldies-bc-cpp,代码行数:15,代码来源:test_AsString.cpp
示例5: set_test_name
void object::test<2>()
{
set_test_name("checks attempt to run test/tests in unexistent group");
try
{
tr.run_tests("unexistent");
fail("expected no_such_group");
}
catch (const no_such_group&)
{
// as expected
}
try
{
test_result r;
tr.run_test("unexistent", 1, r);
fail("expected tut::no_such_group");
}
catch (const no_such_group& )
{
// as expected
}
try
{
tr.set_callback(&callback);
tr.run_tests("unexistent");
fail("expected tut::no_such_group");
}
catch (const no_such_group&)
{
// as expected
}
try
{
tr.set_callback(&callback);
test_result r;
tr.run_test("unexistent", 1, r);
fail("expected tut::no_such_group");
}
catch (const no_such_group&)
{
// as expected
}
}
开发者ID:JerkWisdom,项目名称:zpublic,代码行数:48,代码来源:runner.cpp
示例6: set_test_name
void object::test<11>()
{
set_test_name("Test to make sure both setWhiteList() functions behave the same");
// Test a valid list
std::vector<std::string> whitelist, empty;
LLSD whitelist_llsd;
whitelist.push_back(std::string(URL_OK));
whitelist_llsd.append(std::string(URL_OK));
LLMediaEntry entry1, entry2;
ensure(get_test_name() + " setWhiteList(s) don't match",
entry1.setWhiteList(whitelist) == LSL_STATUS_OK &&
entry2.setWhiteList(whitelist_llsd)== LSL_STATUS_OK );
ensure(get_test_name() + " failed",
entry1.getWhiteList() == entry2.getWhiteList());
}
开发者ID:Xara,项目名称:Opensource-V2-SL-Viewer,代码行数:16,代码来源:llmediaentry_test.cpp
示例7: set_test_name
void fixture::test<1>()
{
set_test_name("detach_state");
pthreadxx::thread_attribute attribute;
ensure_equals("default state", attribute.detach_state(),
PTHREAD_CREATE_JOINABLE);
attribute.detach_state(PTHREAD_CREATE_DETACHED);
ensure_equals("set detached state", attribute.detach_state(),
PTHREAD_CREATE_DETACHED);
attribute.detach_state(PTHREAD_CREATE_JOINABLE);
ensure_equals("set joinable state", attribute.detach_state(),
PTHREAD_CREATE_JOINABLE);
}
开发者ID:windreamer,项目名称:tire,代码行数:16,代码来源:thread_attribute.cpp
示例8: set_test_name
void TestRegistry::test<1>()
{
set_test_name("RotateAboutX (3x3 matrix)");
a3f[0] = 2.0f; a3f[3] = 5.0f; a3f[6] = 8.0f;
a3f[1] = 3.0f; a3f[4] = 6.0f; a3f[7] = 9.0f;
a3f[2] = 4.0f; a3f[5] = 7.0f; a3f[8] = 10.0f;
degrees = 123.4f;
radians = toRadians(degrees);
c = std::cos(radians);
s = std::sin(radians);
jship::Hazmat::RotateAboutX(a3f, radians, b3f);
DOUBLES_EQUAL(a3f[ 0], 2.0, 1e-5);
DOUBLES_EQUAL(a3f[ 1], 3.0, 1e-5);
DOUBLES_EQUAL(a3f[ 2], 4.0, 1e-5);
DOUBLES_EQUAL(a3f[ 3], 5.0, 1e-5);
DOUBLES_EQUAL(a3f[ 4], 6.0, 1e-5);
DOUBLES_EQUAL(a3f[ 5], 7.0, 1e-5);
DOUBLES_EQUAL(a3f[ 6], 8.0, 1e-5);
DOUBLES_EQUAL(a3f[ 7], 9.0, 1e-5);
DOUBLES_EQUAL(a3f[ 8], 10.0, 1e-5);
DOUBLES_EQUAL(b3f[ 0], 2.0f, 1e-5);
DOUBLES_EQUAL(b3f[ 1], 3.0f * c - 4.0f * s, 1e-5);
DOUBLES_EQUAL(b3f[ 2], 4.0f * c + 3.0f * s, 1e-5);
DOUBLES_EQUAL(b3f[ 3], 5.0f, 1e-5);
DOUBLES_EQUAL(b3f[ 4], 6.0f * c - 7.0f * s, 1e-5);
DOUBLES_EQUAL(b3f[ 5], 7.0f * c + 6.0f * s, 1e-5);
DOUBLES_EQUAL(b3f[ 6], 8.0f, 1e-5);
DOUBLES_EQUAL(b3f[ 7], 9.0f * c - 10.0f * s, 1e-5);
DOUBLES_EQUAL(b3f[ 8], 10.0f * c + 9.0f * s, 1e-5);
jship::Hazmat::RotateAboutX(a3f, radians, a3f);
DOUBLES_EQUAL(a3f[ 0], 2.0f, 1e-5);
DOUBLES_EQUAL(a3f[ 1], 3.0f * c - 4.0f * s, 1e-5);
DOUBLES_EQUAL(a3f[ 2], 4.0f * c + 3.0f * s, 1e-5);
DOUBLES_EQUAL(a3f[ 3], 5.0f, 1e-5);
DOUBLES_EQUAL(a3f[ 4], 6.0f * c - 7.0f * s, 1e-5);
DOUBLES_EQUAL(a3f[ 5], 7.0f * c + 6.0f * s, 1e-5);
DOUBLES_EQUAL(a3f[ 6], 8.0f, 1e-5);
DOUBLES_EQUAL(a3f[ 7], 9.0f * c - 10.0f * s, 1e-5);
DOUBLES_EQUAL(a3f[ 8], 10.0f * c + 9.0f * s, 1e-5);
}
开发者ID:jship,项目名称:Hazmat,代码行数:47,代码来源:TestRotateAboutX.cpp
示例9: set_test_name
void object::test<3>()
{
set_test_name("checks no_throw");
try
{
ensure_NO_THROW( skip() );
throw std::runtime_error("no_throw doesn't work");
}
catch (const failure& ex)
{
if (std::string(ex.what()).find("skip()") == std::string::npos )
{
fail("no_throw doesn't contain proper message");
}
}
}
开发者ID:brehm,项目名称:tut-framework,代码行数:17,代码来源:ensure_throw.cpp
示例10: set_test_name
void processor_object_t::test<1>()
{
set_test_name("LLProcessorInfo regression test");
LLProcessorInfo pi;
F64 freq = pi.getCPUFrequency();
//bool sse = pi.hasSSE();
//bool sse2 = pi.hasSSE2();
//bool alitvec = pi.hasAltivec();
std::string family = pi.getCPUFamilyName();
std::string brand = pi.getCPUBrandName();
//std::string steam = pi.getCPUFeatureDescription();
ensure_not_equals("Unknown Brand name", brand, "Unknown");
ensure_not_equals("Unknown Family name", family, "Unknown");
ensure("Reasonable CPU Frequency > 100 && < 10000", freq > 100 && freq < 10000);
}
开发者ID:jimjesus,项目名称:kittyviewer,代码行数:17,代码来源:llprocessor_test.cpp
示例11: set_test_name
void object::test<1>() {
static int frame = 0;
set_test_name("Initialize network environment");
elf::net_listen(0, "test_server", "localhost", 6670);
elf::net_connect(0, "test_client", "localhost", 6670);
while (true) {
elf::net_proc();
usleep(50000);
if (++frame % 20 == 0) {
putchar('.');
fflush(stdout);
}
}
ensure(true);
}
开发者ID:youngtrips,项目名称:elfox,代码行数:17,代码来源:test_net.cpp
示例12: set_test_name
void llprimitive_object_t::test<6>()
{
set_test_name("Test setVolume creation of new NOT-unique volume.");
LLPrimitive primitive;
LLVolumeParams params;
// Make sure volume starts off null
ensure(primitive.getVolume() == NULL);
// Make sure we have no texture entries before setting the volume
ensure_equals(primitive.getNumTEs(), 0);
// Test that GEOMETRY has not been flagged as changed.
ensure(!primitive.isChanged(LLXform::GEOMETRY));
// Make sure setVolume returns true
ensure(primitive.setVolume(params, 0, false) == TRUE);
LLVolume* new_volume = primitive.getVolume();
// make sure new volume was actually created
ensure(new_volume != NULL);
// Make sure that now that we've set the volume we have texture entries
ensure_not_equals(primitive.getNumTEs(), 0);
// Make sure that the number of texture entries equals the number of faces in the volume (should be 6)
ensure_equals(new_volume->getNumFaces(), 6);
ensure_equals(primitive.getNumTEs(), new_volume->getNumFaces());
// Test that GEOMETRY has been flagged as changed.
ensure(primitive.isChanged(LLXform::GEOMETRY));
// Run it twice to make sure it doesn't create a different one if params are the same
ensure(primitive.setVolume(params, 0, false) == FALSE);
ensure(new_volume == primitive.getVolume());
// Change the param definition and try setting it again.
params.setRevolutions(4);
ensure(primitive.setVolume(params, 0, false) == TRUE);
// Ensure that we now have a different volume
ensure(new_volume != primitive.getVolume());
}
开发者ID:9skunks,项目名称:imprudence,代码行数:44,代码来源:llprimitive_test.cpp
示例13: set_test_name
void object::test<3>()
{
set_test_name("function names");
setCode(),
"module Asia;",
"_() -> void { }",
" a() -> void { }",
" a15() -> void { }",
" _123135() -> void { }",
" aAa() -> void { }",
" _64_characters__________________________________________________() -> void { }";
parse();
ensure_success();
ensure_equals("6 declarations", module->decls.size(), 6u);
ensure("function", module->decls[0].type() == typeid(sl::cst::Function));
ensure("function", module->decls[1].type() == typeid(sl::cst::Function));
ensure("function", module->decls[2].type() == typeid(sl::cst::Function));
ensure("function", module->decls[3].type() == typeid(sl::cst::Function));
ensure("function", module->decls[4].type() == typeid(sl::cst::Function));
ensure("function", module->decls[5].type() == typeid(sl::cst::Function));
sl::cst::Function& f0 = boost::get<sl::cst::Function>(module->decls[0]);
sl::cst::Function& f1 = boost::get<sl::cst::Function>(module->decls[1]);
sl::cst::Function& f2 = boost::get<sl::cst::Function>(module->decls[2]);
sl::cst::Function& f3 = boost::get<sl::cst::Function>(module->decls[3]);
sl::cst::Function& f4 = boost::get<sl::cst::Function>(module->decls[4]);
sl::cst::Function& f5 = boost::get<sl::cst::Function>(module->decls[5]);
ensure("position 0", f0.name.pos == sl::FilePosition("", 2, 1));
ensure_equals("name 0", f0.name.str, "_");
ensure("position 1", f1.name.pos == sl::FilePosition("", 3, 2));
ensure_equals("name 1", f1.name.str, "a");
ensure("position 2", f2.name.pos == sl::FilePosition("", 4, 3));
ensure_equals("name 2", f2.name.str, "a15");
ensure("position 3", f3.name.pos == sl::FilePosition("", 5, 4));
ensure_equals("name 3", f3.name.str, "_123135");
ensure("position 4", f4.name.pos == sl::FilePosition("", 6, 5));
ensure_equals("name 4", f4.name.str, "aAa");
ensure("position 5", f5.name.pos == sl::FilePosition("", 7, 6));
ensure_equals("name 5", f5.name.str, "_64_characters__________________________________________________");
}
开发者ID:rozz666,项目名称:SLCC,代码行数:44,代码来源:parseFile_ut.cpp
示例14: set_test_name
void filter_object::test<4>()
{
set_test_name("LLEventTimeout::errorAfter()");
WrapLLErrs capture;
LLEventPump& driver(pumps.obtain("driver"));
TestEventTimeout filter(driver);
listener0.reset(0);
LLTempBoundListener temp1(
listener0.listenTo(filter));
filter.errorAfter(20, "timeout");
// Okay, (fake) timer is ticking. 'filter' can only sense the timer
// when we pump mainloop. Do that right now to take the logic path
// before either the anticipated event arrives or the timer expires.
mainloop.post(17);
check_listener("no timeout 1", listener0, LLSD(0));
// Expected event arrives...
driver.post(1);
check_listener("event passed thru", listener0, LLSD(1));
// Should have canceled the timer. Verify that by asserting that the
// time has expired, then pumping mainloop again.
filter.forceTimeout();
mainloop.post(17);
check_listener("no timeout 2", listener0, LLSD(1));
// Set timer again.
filter.errorAfter(20, "timeout");
// Now let the timer expire.
filter.forceTimeout();
// Notice the timeout.
std::string threw;
try
{
mainloop.post(17);
}
catch (const WrapLLErrs::FatalException& e)
{
threw = e.what();
}
ensure_contains("errorAfter() timeout exception", threw, "timeout");
// Timing out cancels the timer. Verify that.
listener0.reset(0);
filter.forceTimeout();
mainloop.post(17);
check_listener("no timeout 3", listener0, LLSD(0));
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:44,代码来源:lleventfilter_test.cpp
示例15: set_test_name
void object::test<1>()
{
set_test_name("request validation");
WrapLL_ERRS capture;
LLSD request;
request["uri"] = uri;
std::string threw;
try
{
pumps.obtain("LLXMLRPCTransaction").post(request);
}
catch (const WrapLL_ERRS::FatalException& e)
{
threw = e.what();
}
ensure_contains("threw exception", threw, "missing params");
ensure_contains("identified missing", threw, "method");
ensure_contains("identified missing", threw, "reply");
}
开发者ID:Krazy-Bish-Margie,项目名称:Thunderstorm,代码行数:19,代码来源:llxmlrpclistener_test.cpp
示例16: set_test_name
void fixture::test<3>()
{
data d;
set_test_name("equal operator");
pthreadxx::thread t1, t2;
ensure("invalid threads are equal", t1 == t2);
ensure_not("invalid threads are not unequal", t1 != t2);
ensure("self compare are equal", t1 == t1);
ensure_not("self compare are not unequal", t1 != t1);
t1=t1;
ensure("self compare are equal", t1 == t1);
ensure_not("self compare are not unequal", t1 != t1);
t1 = pthreadxx::thread::create(d);
ensure_not("threads are unequal", t1 == t2);
ensure("invalid threads are not equal", t1 != t2);
t2 = pthreadxx::thread::create(d);
ensure_not("threads are unequal", t1 == t2);
ensure("invalid threads are not equal", t1 != t2);
}
开发者ID:windreamer,项目名称:tire,代码行数:19,代码来源:thread.cpp
示例17: set_test_name
void fixture::test<4>()
{
set_test_name("test add multiple node");
algorithm::const_hash hash;
int count = random (1, 20);
for (int i = 0; i < count; ++i)
{
int weight = random(100, 200);
hash.add(i, weight);
ensure_equals("hash weight", hash.weight(i), weight);
}
ensure_equals("hash count", hash.alive_set().size(), count);
int loop = random (200, 300);
for (int i = 0; i < loop; ++i)
{
ensure("node in alive_set",
hash.alive_set().count(hash.hash(random())) == 1);
}
}
开发者ID:windreamer,项目名称:tire,代码行数:19,代码来源:consthash.cpp
示例18: set_test_name
void TestRegistry::test<2>()
{
set_test_name("Cofactor (3x3 matrix)");
// Determinant of this matrix is -2
a3f[0] = 5.0f; a3f[3] = 6.0f; a3f[6] = 3.0f;
a3f[1] = 4.0f; a3f[4] = 3.0f; a3f[7] = 1.0f;
a3f[2] = 1.0f; a3f[5] = 4.0f; a3f[8] = 3.0f;
jship::Hazmat::Cofactor(a3f, b3f);
DOUBLES_EQUAL(a3f[0], 5.0, 1e-5);
DOUBLES_EQUAL(a3f[1], 4.0, 1e-5);
DOUBLES_EQUAL(a3f[2], 1.0, 1e-5);
DOUBLES_EQUAL(a3f[3], 6.0, 1e-5);
DOUBLES_EQUAL(a3f[4], 3.0, 1e-5);
DOUBLES_EQUAL(a3f[5], 4.0, 1e-5);
DOUBLES_EQUAL(a3f[6], 3.0, 1e-5);
DOUBLES_EQUAL(a3f[7], 1.0, 1e-5);
DOUBLES_EQUAL(a3f[8], 3.0, 1e-5);
DOUBLES_EQUAL(b3f[0], 5.0, 1e-5);
DOUBLES_EQUAL(b3f[1], -6.0, 1e-5);
DOUBLES_EQUAL(b3f[2], -3.0, 1e-5);
DOUBLES_EQUAL(b3f[3], -11.0, 1e-5);
DOUBLES_EQUAL(b3f[4], 12.0, 1e-5);
DOUBLES_EQUAL(b3f[5], 7.0, 1e-5);
DOUBLES_EQUAL(b3f[6], 13.0, 1e-5);
DOUBLES_EQUAL(b3f[7], -14.0, 1e-5);
DOUBLES_EQUAL(b3f[8], -9.0, 1e-5);
jship::Hazmat::Cofactor(a3f, a3f);
DOUBLES_EQUAL(a3f[0], 5.0, 1e-5);
DOUBLES_EQUAL(a3f[1], -6.0, 1e-5);
DOUBLES_EQUAL(a3f[2], -3.0, 1e-5);
DOUBLES_EQUAL(a3f[3], -11.0, 1e-5);
DOUBLES_EQUAL(a3f[4], 12.0, 1e-5);
DOUBLES_EQUAL(a3f[5], 7.0, 1e-5);
DOUBLES_EQUAL(a3f[6], 13.0, 1e-5);
DOUBLES_EQUAL(a3f[7], -14.0, 1e-5);
DOUBLES_EQUAL(a3f[8], -9.0, 1e-5);
}
开发者ID:jship,项目名称:Hazmat,代码行数:43,代码来源:TestCofactor.cpp
示例19: set_test_name
void object::test<7>()
{
set_test_name("delete Unkeyed with outstanding instance_iter");
std::string what;
Unkeyed* unkeyed = new Unkeyed;
{
WrapLL_ERRS wrapper;
Unkeyed::instance_iter i(Unkeyed::beginInstances());
try
{
delete unkeyed;
}
catch (const WrapLL_ERRS::FatalException& e)
{
what = e.what();
}
}
ensure(! what.empty());
}
开发者ID:HizWylder,项目名称:GIS,代码行数:19,代码来源:llinstancetracker_test.cpp
示例20: set_test_name
void TestRegistry::test<2>()
{
set_test_name("Transpose (3x3 matrix)");
a3f[0] = 0.0f; a3f[3] = 3.0f; a3f[6] = 6.0f;
a3f[1] = 1.0f; a3f[4] = 4.0f; a3f[7] = 7.0f;
a3f[2] = 2.0f; a3f[5] = 5.0f; a3f[8] = 8.0f;
jship::Hazmat::Transpose(a3f, b3f);
DOUBLES_EQUAL(a3f[0], 0.0, 1e-5);
DOUBLES_EQUAL(a3f[1], 1.0, 1e-5);
DOUBLES_EQUAL(a3f[2], 2.0, 1e-5);
DOUBLES_EQUAL(a3f[3], 3.0, 1e-5);
DOUBLES_EQUAL(a3f[4], 4.0, 1e-5);
DOUBLES_EQUAL(a3f[5], 5.0, 1e-5);
DOUBLES_EQUAL(a3f[6], 6.0, 1e-5);
DOUBLES_EQUAL(a3f[7], 7.0, 1e-5);
DOUBLES_EQUAL(a3f[8], 8.0, 1e-5);
DOUBLES_EQUAL(b3f[0], 0.0, 1e-5);
DOUBLES_EQUAL(b3f[1], 3.0, 1e-5);
DOUBLES_EQUAL(b3f[2], 6.0, 1e-5);
DOUBLES_EQUAL(b3f[3], 1.0, 1e-5);
DOUBLES_EQUAL(b3f[4], 4.0, 1e-5);
DOUBLES_EQUAL(b3f[5], 7.0, 1e-5);
DOUBLES_EQUAL(b3f[6], 2.0, 1e-5);
DOUBLES_EQUAL(b3f[7], 5.0, 1e-5);
DOUBLES_EQUAL(b3f[8], 8.0, 1e-5);
jship::Hazmat::Transpose(a3f, a3f);
DOUBLES_EQUAL(a3f[0], 0.0, 1e-5);
DOUBLES_EQUAL(a3f[1], 3.0, 1e-5);
DOUBLES_EQUAL(a3f[2], 6.0, 1e-5);
DOUBLES_EQUAL(a3f[3], 1.0, 1e-5);
DOUBLES_EQUAL(a3f[4], 4.0, 1e-5);
DOUBLES_EQUAL(a3f[5], 7.0, 1e-5);
DOUBLES_EQUAL(a3f[6], 2.0, 1e-5);
DOUBLES_EQUAL(a3f[7], 5.0, 1e-5);
DOUBLES_EQUAL(a3f[8], 8.0, 1e-5);
}
开发者ID:jship,项目名称:Hazmat,代码行数:42,代码来源:TestTranspose.cpp
注:本文中的set_test_name函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论