コード例 #1
0
TEST_F(ModelFixture, Schedule_FinalStrictness) {
  Model model;
  ScheduleConstant schedule(model);
  schedule.setValue(-0.1);
  EXPECT_TRUE(checkOrAssignScheduleTypeLimits("Lights","Lighting",schedule));
  ValidityReport report = schedule.validityReport(StrictnessLevel(StrictnessLevel::Final));
  ASSERT_EQ(0u,report.numErrors());
  schedule.setValue(0.5);
  report = schedule.validityReport(StrictnessLevel(StrictnessLevel::Final));
  EXPECT_EQ(0u,report.numErrors());
}
コード例 #2
0
TEST_F(ModelFixture, Schedule_FinalStrictness) {
  Model model;
  ScheduleConstant schedule(model);
  schedule.setValue(-0.1);
  EXPECT_TRUE(checkOrAssignScheduleTypeLimits("Lights","Lighting",schedule));
  ValidityReport report = schedule.validityReport(StrictnessLevel(StrictnessLevel::Final));
  ASSERT_EQ(1u,report.numErrors());
  DataError error = report.nextError().get();
  EXPECT_EQ(DataErrorType(DataErrorType::NumericBound),error.type());
  schedule.setValue(0.5);
  report = schedule.validityReport(StrictnessLevel(StrictnessLevel::Final));
  EXPECT_EQ(0u,report.numErrors());
}
コード例 #3
0
TEST_F(IdfFixture, IdfFile_BasicTests_LoadedFile)
{
  // as loaded
  EXPECT_TRUE(epIdfFile.objects().size() > 0);
  LOG(Info,"Checking validity of epIdfFile.");
  ValidityReport report = epIdfFile.validityReport(StrictnessLevel::Final);
  EXPECT_EQ(static_cast<unsigned>(0),report.numErrors());
  if (report.numErrors() > 0) {
    LOG(Error,"epIdfFile is not valid at Strictness Final. The ValidityReport follows." 
        << std::endl << report);
  }

  // write out as Idf for diff
  openstudio::path outPath = outDir/toPath("RoundTrip_in.idf");
  openstudio::Time start = openstudio::Time::currentTime();
  epIdfFile.save(outPath,true);
  openstudio::Time writeTime = openstudio::Time::currentTime() - start;
  LOG(Info, "IdfFile written to idf text in " << writeTime << "s. Please check diff by hand.");
}