MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / TEST_F

Function TEST_F

src/utilities/units/test/ScaleFactory_GTest.cpp:30–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28using openstudio::nano;
29
30TEST_F(UnitsFixture, ScaleFactory_RegisteredScales) {
31
32 LOG(Debug, "ScaleFactory_RegisteredScales");
33
34 // ETH@20100909 Using ScaleFactory instead of ScaleFactory in an attempt
35 // to get ScaleFactory.hpp to show up in coverage analysis.
36 std::vector<Scale> scales = ScaleFactory::instance().registeredScales();
37
38 std::stringstream vectorOut;
39 std::stringstream factoryOut;
40
41 std::vector<Scale>::const_iterator scaleIter;
42 auto scaleEnd = scales.end();
43 for (scaleIter = scales.begin(); scaleIter != scaleEnd; ++scaleIter) {
44 vectorOut << *scaleIter << '\n';
45 }
46
47 factoryOut << ScaleFactory::instance();
48 std::string factoryOutFromInstance = factoryOut.str();
49
50 EXPECT_FALSE(factoryOutFromInstance.empty());
51 EXPECT_TRUE(factoryOutFromInstance == vectorOut.str());
52
53 // print to log so can add formatting if desired
54 LOG(Info, factoryOutFromInstance);
55
56 factoryOut.str("");
57 factoryOut << openstudio::printScales();
58 EXPECT_EQ(factoryOutFromInstance, factoryOut.str());
59}
60
61// Create from abbreviaitons--needed for parsing quantities.
62TEST_F(UnitsFixture, ScaleFactory_CreateFromAbbreviation) {

Callers

nothing calls this directly

Calls 11

printScalesFunction · 0.85
testNumbersEqualFunction · 0.85
oneFunction · 0.85
registeredScalesMethod · 0.80
beginMethod · 0.80
createScaleMethod · 0.80
sFunction · 0.50
powFunction · 0.50
endMethod · 0.45
strMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected