本文整理汇总了C++中Problem::fileTypesAreCompatible方法的典型用法代码示例。如果您正苦于以下问题:C++ Problem::fileTypesAreCompatible方法的具体用法?C++ Problem::fileTypesAreCompatible怎么用?C++ Problem::fileTypesAreCompatible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Problem
的用法示例。
在下文中一共展示了Problem::fileTypesAreCompatible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dv
TEST_F(AnalysisDriverFixture,SimpleProject_InsertMeasure) {
// create a new project
SimpleProject project = getCleanSimpleProject("SimpleProject_InsertMeasure");
// open a measure
openstudio::path dir = resourcesPath() / toPath("/utilities/BCL/Measures/SetWindowToWallRatioByFacade");
BCLMeasure measure = BCLMeasure::load(dir).get();
// insert it into the project
BCLMeasure projectMeasure = project.insertMeasure(measure);
// verify that there is a project-specific copy
EXPECT_NE(toString(measure.directory()),toString(projectMeasure.directory()));
openstudio::path scriptsDir = project.projectDir() / toPath("scripts");
EXPECT_EQ(toString(completeAndNormalize(scriptsDir)),
toString(completeAndNormalize(projectMeasure.directory().parent_path())));
EXPECT_EQ(measure.uuid(),projectMeasure.uuid());
EXPECT_EQ(measure.versionUUID(),projectMeasure.versionUUID()); // DLM: should this be not equal?
// verify that it can be retrieved from the project, but its arguments cannot
ASSERT_TRUE(project.getMeasureByUUID(measure.uuid()));
BCLMeasure temp = project.getMeasureByUUID(measure.uuid()).get();
EXPECT_EQ(toString(projectMeasure.directory()),toString(temp.directory()));
EXPECT_EQ(projectMeasure.uuid(),temp.uuid());
EXPECT_EQ(projectMeasure.versionUUID(),temp.versionUUID());
EXPECT_EQ(1u,project.measures().size());
// use embedded Ruby to extract the arguments
// (see AnalysisDriverFixture.cpp for interpreter set-up)
OSArgumentVector args = argumentGetter->getArguments(projectMeasure,
project.seedModel(),
project.seedIdf());
EXPECT_FALSE(args.empty());
// register and subsequently retrieve those arguments
project.registerArguments(measure,args); // doesn't matter which copy of the measure we use
EXPECT_TRUE(project.hasStoredArguments(temp));
OSArgumentVector argsCopy = project.getStoredArguments(projectMeasure);
ASSERT_EQ(args.size(),argsCopy.size());
for (int i = 0, n = args.size(); i < n; ++i) {
EXPECT_EQ(args[i].name(),argsCopy[i].name());
EXPECT_EQ(args[i].type(),argsCopy[i].type());
}
// use this measure to create a new variable/ruby measure
// now it is important to use the copy in the project
MeasureGroup dv("New Measure Group",MeasureVector());
Problem problem = project.analysis().problem();
problem.push(dv);
// here, expect this test to pass.
// in pat, if it fails, let user know and call problem.erase(dv).
EXPECT_TRUE(problem.fileTypesAreCompatible(dv,
projectMeasure.inputFileType(),
projectMeasure.outputFileType()));
EXPECT_TRUE(dv.push(RubyMeasure(projectMeasure)));
}