本文整理汇总了C++中UtestShell类的典型用法代码示例。如果您正苦于以下问题:C++ UtestShell类的具体用法?C++ UtestShell怎么用?C++ UtestShell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UtestShell类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: helperDoRunOneTest
static void helperDoRunOneTest(void* data)
{
HelperTestRunInfo* runInfo = (HelperTestRunInfo*) data;
UtestShell* shell = runInfo->shell_;
TestPlugin* plugin = runInfo->plugin_;
TestResult* result = runInfo->result_;
shell->runOneTest(plugin, *result);
}
开发者ID:Scopher,项目名称:cpputest,代码行数:10,代码来源:Utest.cpp
示例2: findTestWithName
UtestShell* TestRegistry::findTestWithName(const SimpleString& name)
{
UtestShell* current = tests_;
while (current) {
if (current->getName() == name)
return current;
current = current->getNext();
}
return NULL;
}
开发者ID:13coders,项目名称:cookiecutter-kata-cpputest,代码行数:10,代码来源:TestRegistry.cpp
示例3: findTestWithGroup
UtestShell* TestRegistry::findTestWithGroup(const SimpleString& group)
{
UtestShell* current = tests_;
while (current) {
if (current->getGroup() == group)
return current;
current = current->getNext();
}
return NULL;
}
开发者ID:13coders,项目名称:cookiecutter-kata-cpputest,代码行数:10,代码来源:TestRegistry.cpp
示例4: printCurrentTestStarted
void TestOutput::printCurrentTestStarted(const UtestShell& test)
{
if (verbose_) print(test.getFormattedName().asCharString());
if (test.willRun()) {
setProgressIndicator(".");
}
else {
setProgressIndicator("!");
}
}
开发者ID:jaymdoyle,项目名称:unit_test_2,代码行数:11,代码来源:TestOutput.cpp
示例5: failIfUndoneFailedAllocs
void FailableMemoryAllocator::failIfUndoneFailedAllocs()
{
for (int i = 0; i < toFailCount_; i++) {
if (allocsToFail_[i] != FAILED_ALLOC_DONE) {
UtestShell* currentTest = UtestShell::getCurrent();
SimpleString failText = StringFromFormat("Expected allocation number %d was never done", allocsToFail_[i]);
currentTest->failWith(FailFailure(currentTest, currentTest->getName().asCharString(),
currentTest->getLineNumber(), failText), TestTerminatorWithoutExceptions());
}
}
}
开发者ID:jkohvakk,项目名称:cpputest,代码行数:11,代码来源:TestMemoryAllocator.cpp
示例6: failIfUndoneFailedLocationAllocs
void FailableMemoryAllocator::failIfUndoneFailedLocationAllocs()
{
for (int i = 0; i < locationToFailCount_; i++) {
if (!locationAllocsToFail_[i].done) {
UtestShell* currentTest = UtestShell::getCurrent();
SimpleString failText = StringFromFormat("Expected failing alloc at %s:%d was never done",
locationAllocsToFail_[i].file,
locationAllocsToFail_[i].line);
currentTest->failWith(FailFailure(currentTest, currentTest->getName().asCharString(),
currentTest->getLineNumber(), failText), TestTerminatorWithoutExceptions());
}
}
}
开发者ID:jkohvakk,项目名称:cpputest,代码行数:13,代码来源:TestMemoryAllocator.cpp
示例7: TEST
TEST(gtest, SimpleGoogleTestGetCalled)
{
StringBufferTestOutput output;
TestResult result(output);
TestPlugin plugin("dummy");
TestRegistry* registry = TestRegistry::getCurrentRegistry();
UtestShell * shell = registry->findTestWithName("GTestEqual");
g_GTestEqual_has_been_called = false;
shell->runOneTest(&plugin, result);
CHECK(g_GTestEqual_has_been_called);
}
开发者ID:UlkUpp,项目名称:cpputest,代码行数:13,代码来源:TestGTest.cpp
示例8: checkAllFailedAllocsWereDone
void FailableMemoryAllocator::checkAllFailedAllocsWereDone()
{
if (head_) {
UtestShell* currentTest = UtestShell::getCurrent();
SimpleString failText;
if (head_->file_)
failText = StringFromFormat("Expected failing alloc at %s:%d was never done", head_->file_, head_->line_);
else
failText = StringFromFormat("Expected allocation number %d was never done", head_->allocNumberToFail_);
currentTest->failWith(FailFailure(currentTest, currentTest->getName().asCharString(),
currentTest->getLineNumber(), failText), TestTerminatorWithoutExceptions());
}
}
开发者ID:KisImre,项目名称:cpputest,代码行数:14,代码来源:TestMemoryAllocator.cpp
示例9: printCurrentTestStarted
void JUnitTestOutput::printCurrentTestStarted(const UtestShell& test)
{
impl_->results_.testCount_++;
impl_->results_.group_ = test.getGroup();
impl_->results_.startTime_ = GetPlatformSpecificTimeInMillis();
if (impl_->results_.tail_ == 0) {
impl_->results_.head_ = impl_->results_.tail_
= new JUnitTestCaseResultNode;
}
else {
impl_->results_.tail_->next_ = new JUnitTestCaseResultNode;
impl_->results_.tail_ = impl_->results_.tail_->next_;
}
impl_->results_.tail_->name_ = test.getName();
}
开发者ID:dhbw-fn-micro,项目名称:cpputest,代码行数:16,代码来源:JUnitTestOutput.cpp
示例10: preTestAction
void MemoryReporterPlugin::preTestAction(UtestShell& test, TestResult& result)
{
if (formatter_ == NULL) return;
initializeAllocator(&mallocAllocator, result);
initializeAllocator(&newAllocator, result);
initializeAllocator(&newArrayAllocator, result);
setGlobalMemoryReportAllocators();
if (test.getGroup() != currentTestGroup_) {
formatter_->report_testgroup_start(&result, test);
currentTestGroup_ = test.getGroup();
}
formatter_->report_test_start(&result, test);
}
开发者ID:CNCBASHER,项目名称:mri,代码行数:17,代码来源:MemoryReporterPlugin.cpp
示例11:
void IEEE754ExceptionsPlugin::postTestAction(UtestShell& test, TestResult& result)
{
if(!test.hasFailed()) {
IEEE754_CHECK_CLEAR(test, result, FE_DIVBYZERO);
IEEE754_CHECK_CLEAR(test, result, FE_OVERFLOW);
IEEE754_CHECK_CLEAR(test, result, FE_UNDERFLOW);
IEEE754_CHECK_CLEAR(test, result, FE_INVALID);
IEEE754_CHECK_CLEAR(test, result, FE_INEXACT);
}
}
开发者ID:FelixAdrianL,项目名称:cpputest,代码行数:10,代码来源:IEEE754ExceptionsPlugin.cpp
示例12:
void IEEE754ExceptionsPlugin::postTestAction(UtestShell& test, TestResult& result)
{
if(!test.hasFailed()) {
IEEE754_CHECK_CLEAR(test, result, FE_DIVBYZERO);
IEEE754_CHECK_CLEAR(test, result, FE_OVERFLOW);
IEEE754_CHECK_CLEAR(test, result, FE_UNDERFLOW);
IEEE754_CHECK_CLEAR(test, result, FE_INVALID); // LCOV_EXCL_LINE (not all platforms support this)
IEEE754_CHECK_CLEAR(test, result, FE_INEXACT);
}
}
开发者ID:13coders,项目名称:cookiecutter-kata-cpputest,代码行数:10,代码来源:IEEE754ExceptionsPlugin.cpp
示例13: postTestAction
void MemoryReporterPlugin::postTestAction(UtestShell& test, TestResult& result)
{
if (formatter_ == NULL) return;
removeGlobalMemoryReportAllocators();
formatter_->report_test_end(&result, test);
if (test.getNext()->getGroup() != currentTestGroup_)
formatter_->report_testgroup_end(&result, test);
}
开发者ID:CNCBASHER,项目名称:mri,代码行数:10,代码来源:MemoryReporterPlugin.cpp
示例14: printCurrentTestStarted
void JUnitTestOutput::printCurrentTestStarted(const UtestShell& test)
{
impl_->results_.testCount_++;
impl_->results_.group_ = test.getGroup();
impl_->results_.startTime_ = GetPlatformSpecificTimeInMillis();
if (impl_->results_.tail_ == NULLPTR) {
impl_->results_.head_ = impl_->results_.tail_
= new JUnitTestCaseResultNode;
}
else {
impl_->results_.tail_->next_ = new JUnitTestCaseResultNode;
impl_->results_.tail_ = impl_->results_.tail_->next_;
}
impl_->results_.tail_->name_ = test.getName();
impl_->results_.tail_->file_ = test.getFile();
impl_->results_.tail_->lineNumber_ = test.getLineNumber();
if (!test.willRun()) {
impl_->results_.tail_->ignored_ = true;
}
}
开发者ID:offa,项目名称:cpputest,代码行数:21,代码来源:JUnitTestOutput.cpp
示例15: listTestGroupNames
void TestRegistry::listTestGroupNames(TestResult& result)
{
SimpleString groupList;
for (UtestShell *test = tests_; test != NULL; test = test->getNext()) {
SimpleString gname;
gname += "#";
gname += test->getGroup();
gname += "#";
if (!groupList.contains(gname)) {
groupList += gname;
groupList += " ";
}
}
groupList.replace("#", "");
if (groupList.endsWith(" "))
groupList = groupList.subString(0, groupList.size() - 1);
result.print(groupList.asCharString());
}
开发者ID:13coders,项目名称:cookiecutter-kata-cpputest,代码行数:22,代码来源:TestRegistry.cpp
示例16: report_testgroup_start
void NormalMemoryReportFormatter::report_testgroup_start(TestResult* result, UtestShell& test)
{
const size_t line_size = 80;
SimpleString groupName = StringFromFormat("TEST GROUP(%s)", test.getGroup().asCharString());
size_t beginPos = (line_size/2) - (groupName.size()/2);
SimpleString line("-", beginPos);
line += groupName;
line += SimpleString("-", line_size - line.size());
line += "\n";
result->print(line.asCharString());
}
开发者ID:CNCBASHER,项目名称:mri,代码行数:13,代码来源:MemoryReportFormatter.cpp
示例17: defaultCrashMethod
// LCOV_EXCL_START - actually covered but not in .gcno due to race condition
static void defaultCrashMethod()
{
UtestShell* ptr = (UtestShell*) 0x0; ptr->countTests();
}
开发者ID:KevinWMatthews,项目名称:cpputest,代码行数:5,代码来源:Utest.cpp
示例18: fail
virtual void fail(char* fail_string)
{
UtestShell* currentTest = UtestShell::getCurrent();
currentTest->getTestResult()->addFailure(FailFailure(currentTest, currentTest->getName().asCharString(), currentTest->getLineNumber(), fail_string));
currentTest->exitCurrentTestWithoutException();
}
开发者ID:MoonE,项目名称:WCETExplorer,代码行数:6,代码来源:MemoryLeakWarningPlugin.cpp
示例19: report_test_end
void NormalMemoryReportFormatter::report_test_end(TestResult* result, UtestShell& test)
{
result->print(StringFromFormat("ENDTEST(%s, %s)\n", test.getGroup().asCharString(), test.getName().asCharString()).asCharString());
}
开发者ID:CNCBASHER,项目名称:mri,代码行数:4,代码来源:MemoryReportFormatter.cpp
示例20: report_testgroup_start
void CodeMemoryReportFormatter::report_testgroup_start(TestResult* result, UtestShell& test)
{
result->print(StringFromFormat("*/TEST_GROUP(%s_memoryReport)\n{\n};\n/*",
test.getGroup().asCharString()).asCharString());
}
开发者ID:UlkUpp,项目名称:cpputest,代码行数:5,代码来源:CodeMemoryReportFormatter.cpp
注:本文中的UtestShell类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论