本文整理汇总了C++中DataPoint::failed方法的典型用法代码示例。如果您正苦于以下问题:C++ DataPoint::failed方法的具体用法?C++ DataPoint::failed怎么用?C++ DataPoint::failed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataPoint
的用法示例。
在下文中一共展示了DataPoint::failed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: seedModel
TEST_F(AnalysisDriverFixture,DataPersistence_DataPointErrors) {
{
// Create and populate project
SimpleProject project = getCleanSimpleProject("DataPersistence_DataPointErrors");
Analysis analysis = project.analysis();
Problem problem = retrieveProblem(AnalysisDriverFixtureProblem::BuggyBCLMeasure,
true,
false);
EXPECT_EQ(5u,problem.workflow().size());
analysis.setProblem(problem);
model::Model model =fastExampleModel();
openstudio::path p = toPath("./example.osm");
model.save(p,true);
FileReference seedModel(p);
project.setSeed(seedModel);
DataPoint dataPoint = problem.createDataPoint(std::vector<QVariant>(problem.numVariables(),0)).get();
analysis.addDataPoint(dataPoint);
// Run analysis
AnalysisRunOptions runOptions = standardRunOptions(project.projectDir());
project.analysisDriver().run(analysis,runOptions);
project.analysisDriver().waitForFinished();
// Check DataPoint job and error information
ASSERT_EQ(1u,analysis.dataPoints().size());
dataPoint = analysis.dataPoints()[0];
EXPECT_TRUE(dataPoint.isComplete());
EXPECT_TRUE(dataPoint.failed());
EXPECT_TRUE(dataPoint.topLevelJob());
WorkflowStepJobVector jobResults = problem.getJobsByWorkflowStep(dataPoint);
EXPECT_EQ(problem.workflow().size(),jobResults.size());
ASSERT_EQ(5u,jobResults.size());
WorkflowStepJob jobResult = jobResults[0];
ASSERT_TRUE(jobResult.job);
EXPECT_TRUE(jobResult.measure);
Job job = jobResult.job.get();
ASSERT_TRUE(jobResult.mergedJobIndex);
EXPECT_EQ(0u,jobResult.mergedJobIndex.get());
EXPECT_FALSE(job.running());
EXPECT_FALSE(job.outOfDate());
EXPECT_FALSE(job.canceled());
EXPECT_TRUE(job.lastRun());
JobErrors treeErrors = job.treeErrors(); // get all tree errors now, test later
JobErrors errors = jobResult.errors().get();
EXPECT_EQ(OSResultValue(OSResultValue::NA),errors.result);
EXPECT_TRUE(errors.succeeded());
EXPECT_TRUE(errors.errors().empty());
EXPECT_TRUE(errors.warnings().empty());
EXPECT_FALSE(errors.infos().empty());
jobResult = jobResults[1];
ASSERT_TRUE(jobResult.job);
EXPECT_FALSE(jobResult.measure);
ASSERT_TRUE(jobResult.step.isWorkItem());
EXPECT_EQ(JobType(JobType::UserScript),jobResult.step.workItemType());
job = jobResult.job.get();
ASSERT_TRUE(jobResult.mergedJobIndex);
EXPECT_EQ(1u,jobResult.mergedJobIndex.get());
EXPECT_FALSE(job.running());
EXPECT_FALSE(job.outOfDate());
EXPECT_FALSE(job.canceled());
EXPECT_TRUE(job.lastRun());
errors = jobResult.errors().get();
EXPECT_EQ(OSResultValue(OSResultValue::Success),errors.result);
EXPECT_TRUE(errors.succeeded());
EXPECT_TRUE(errors.errors().empty());
EXPECT_FALSE(errors.warnings().empty());
EXPECT_TRUE(errors.infos().empty());
jobResult = jobResults[2];
ASSERT_TRUE(jobResult.job);
EXPECT_TRUE(jobResult.measure);
job = jobResult.job.get();
ASSERT_TRUE(jobResult.mergedJobIndex);
EXPECT_EQ(2u,jobResult.mergedJobIndex.get());
EXPECT_FALSE(job.running());
EXPECT_FALSE(job.outOfDate());
EXPECT_FALSE(job.canceled());
EXPECT_TRUE(job.lastRun());
errors = jobResult.errors().get();
EXPECT_EQ(OSResultValue(OSResultValue::Fail),errors.result);
EXPECT_FALSE(errors.succeeded());
EXPECT_FALSE(errors.errors().empty());
EXPECT_TRUE(errors.warnings().empty());
EXPECT_TRUE(errors.infos().empty());
jobResult = jobResults[3];
ASSERT_TRUE(jobResult.job);
EXPECT_FALSE(jobResult.measure);
ASSERT_TRUE(jobResult.step.isWorkItem());
EXPECT_EQ(JobType(JobType::UserScript),jobResult.step.workItemType());
job = jobResult.job.get();
ASSERT_TRUE(jobResult.mergedJobIndex);
EXPECT_EQ(3u,jobResult.mergedJobIndex.get());
EXPECT_FALSE(job.running());
EXPECT_FALSE(job.outOfDate()); // now all four scripts are in same job
EXPECT_FALSE(job.canceled());
EXPECT_TRUE(job.lastRun()); // now all four scripts are in same job
errors = jobResult.errors().get();
//.........这里部分代码省略.........