本文整理汇总了C++中set_test_name函数的典型用法代码示例。如果您正苦于以下问题:C++ set_test_name函数的具体用法?C++ set_test_name怎么用?C++ set_test_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_test_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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() == "");
}
示例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());
}
示例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);
}
示例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
}
}
示例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());
}
示例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);
}
示例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);
}
示例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");
}
}
}
示例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);
}
示例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);
}
示例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());
}
示例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__________________________________________________");
}
示例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));
}
示例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");
}