当前位置: 首页>>代码示例>>C++>>正文


C++ Tools::getTool方法代码示例

本文整理汇总了C++中Tools::getTool方法的典型用法代码示例。如果您正苦于以下问题:C++ Tools::getTool方法的具体用法?C++ Tools::getTool怎么用?C++ Tools::getTool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tools的用法示例。


在下文中一共展示了Tools::getTool方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ToolLocationInfo

TEST_F(RunManagerTestFixture, ConfigOptionsTest)
{
  using namespace openstudio;
  using namespace openstudio::runmanager;

  ConfigOptions co;

  co.reset();

  ToolVersion e1(5,4,2);
  ToolVersion e2(3,2,1);
  ToolVersion e3(3,1,2);
  ToolVersion e4(2,7);
  ToolVersion e5(2,7,1);
  ToolVersion e6(2);
  ToolVersion e7(8,4,2,"TAG");

  ToolLocationInfo p1 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e1"));
  ToolLocationInfo p2 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e2"));
  ToolLocationInfo p3 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e3"));
  ToolLocationInfo p4 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e4"));
  ToolLocationInfo p5 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e5"));
  ToolLocationInfo p6 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e6"));
  ToolLocationInfo p7 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e7"));

  co.setToolLocation(e6, p6);
  co.setToolLocation(e5, p5);
  co.setToolLocation(e3, p3);
  co.setToolLocation(e1, p1);
  co.setToolLocation(e4, p4);
  co.setToolLocation(e2, p2);
  co.setToolLocation(e7, p7);


  // getEnergyPlus returns the most completely specified version of E+ that matches the passed
  // in requirements

  EXPECT_EQ(static_cast<size_t>(7), co.getToolLocations().size());

  Tools tools = co.getTools();

  EXPECT_EQ(tools.getTool("energyplus").version, e7);
  EXPECT_EQ(tools.getTool("energyplus", e3).version, e3);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(3)).version, e2);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(3, 2)).version, e2);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(3, 1)).version, e3);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(2)).version, e5);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(8)).version, e7);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(8,4)).version, e7);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(8,4,2)).version, e7);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(8,4,2, "TAG")).version, e7);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(boost::none,boost::none,boost::none,boost::optional<std::string>("TAG"))).version, e7);

  co.reset();

  EXPECT_EQ(co.getToolLocations().size(), static_cast<size_t>(0));
}
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:57,代码来源:ConfigOptions_GTest.cpp


注:本文中的Tools::getTool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。