diff --git a/test/InputDifferentEmissivities.unit.cpp b/test/InputDifferentEmissivities.unit.cpp index 191de2d..b0fe35d 100644 --- a/test/InputDifferentEmissivities.unit.cpp +++ b/test/InputDifferentEmissivities.unit.cpp @@ -48,17 +48,17 @@ TEST_F(TestDifferentEmissivities, Test1) { const std::string inputFile = R"(InputDifferentEmissivities.dat)"; OpticsParser::Parser parser; - std::shared_ptr product = parser.parseFile(inputFile); + auto product = parser.parseFile(inputFile); - EXPECT_NEAR(3.048, product->thickness.value(), 1e-6); - EXPECT_NEAR(1, product->conductivity.value(), 1e-6); - EXPECT_NEAR(0, product->IRTransmittance.value(), 1e-6); - EXPECT_NEAR(0.5, product->frontEmissivity.value(), 1e-6); - EXPECT_NEAR(0.84, product->backEmissivity.value(), 1e-6); - EXPECT_EQ(102, product->nfrcid.value()); - EXPECT_EQ("Generic Clear Glass", product->productName); - EXPECT_EQ("glazing", product->productType); - EXPECT_EQ("Monolithic", product->productSubtype); + EXPECT_NEAR(3.048, product.thickness.value(), 1e-6); + EXPECT_NEAR(1, product.conductivity.value(), 1e-6); + EXPECT_NEAR(0, product.IRTransmittance.value(), 1e-6); + EXPECT_NEAR(0.5, product.frontEmissivity.value(), 1e-6); + EXPECT_NEAR(0.84, product.backEmissivity.value(), 1e-6); + EXPECT_EQ(102, product.nfrcid.value()); + EXPECT_EQ("Generic Clear Glass", product.productName); + EXPECT_EQ("glazing", product.productType); + EXPECT_EQ("Monolithic", product.productSubtype); std::vector correctResults{{0.300, 0.0020, 0.0470, 0.0480}, {0.305, 0.0030, 0.0470, 0.0480}, @@ -68,7 +68,7 @@ TEST_F(TestDifferentEmissivities, Test1) {0.325, 0.2180, 0.0490, 0.0500}}; auto & givenResults = - std::get>(product->measurements.value()); + std::get>(product.measurements.value()); EXPECT_EQ(correctResults.size(), givenResults.size()); for(auto i = 0u; i < correctResults.size(); ++i) { diff --git a/test/InputFile1.unit.cpp b/test/InputFile1.unit.cpp index 604c1cd..4633e54 100644 --- a/test/InputFile1.unit.cpp +++ b/test/InputFile1.unit.cpp @@ -48,17 +48,17 @@ TEST_F(TestFile1, Test1) { const std::string inputFile = R"(InputFile1.dat)"; OpticsParser::Parser parser; - std::shared_ptr product = parser.parseFile(inputFile); + auto product = parser.parseFile(inputFile); - EXPECT_NEAR(3.048, product->thickness.value(), 1e-6); - EXPECT_NEAR(1, product->conductivity.value(), 1e-6); - EXPECT_NEAR(0, product->IRTransmittance.value(), 1e-6); - EXPECT_NEAR(0.84, product->frontEmissivity.value(), 1e-6); - EXPECT_NEAR(0.84, product->backEmissivity.value(), 1e-6); - EXPECT_EQ(102, product->nfrcid.value()); - EXPECT_EQ("Generic Clear Glass", product->productName); - EXPECT_EQ("glazing", product->productType); - EXPECT_EQ("Monolithic", product->productSubtype); + EXPECT_NEAR(3.048, product.thickness.value(), 1e-6); + EXPECT_NEAR(1, product.conductivity.value(), 1e-6); + EXPECT_NEAR(0, product.IRTransmittance.value(), 1e-6); + EXPECT_NEAR(0.84, product.frontEmissivity.value(), 1e-6); + EXPECT_NEAR(0.84, product.backEmissivity.value(), 1e-6); + EXPECT_EQ(102, product.nfrcid.value()); + EXPECT_EQ("Generic Clear Glass", product.productName); + EXPECT_EQ("glazing", product.productType); + EXPECT_EQ("Monolithic", product.productSubtype); std::vector correctResults{{0.300, 0.0020, 0.0470, 0.0480}, @@ -69,7 +69,7 @@ TEST_F(TestFile1, Test1) {0.325, 0.2180, 0.0490, 0.0500}}; auto & givenResults = - std::get>(product->measurements.value()); + std::get>(product.measurements.value()); EXPECT_EQ(correctResults.size(), givenResults.size()); for(auto i = 0u; i < correctResults.size(); ++i) { @@ -88,17 +88,17 @@ TEST_F(TestFile1, TestParseFile) { const std::string inputFile = R"(InputFile1.dat)"; OpticsParser::Parser parser; - std::shared_ptr productData = parser.parseFile(inputFile); + auto productData = parser.parseFile(inputFile); - EXPECT_NEAR(3.048, productData->thickness.value(), 1e-6); - EXPECT_NEAR(1, productData->conductivity.value(), 1e-6); - EXPECT_NEAR(0, productData->IRTransmittance.value(), 1e-6); - EXPECT_NEAR(0.84, productData->frontEmissivity.value(), 1e-6); - EXPECT_NEAR(0.84, productData->backEmissivity.value(), 1e-6); - EXPECT_EQ(102, productData->nfrcid.value()); - EXPECT_EQ("Generic Clear Glass", productData->productName); - EXPECT_EQ("glazing", productData->productType); - EXPECT_EQ("Monolithic", productData->productSubtype); + EXPECT_NEAR(3.048, productData.thickness.value(), 1e-6); + EXPECT_NEAR(1, productData.conductivity.value(), 1e-6); + EXPECT_NEAR(0, productData.IRTransmittance.value(), 1e-6); + EXPECT_NEAR(0.84, productData.frontEmissivity.value(), 1e-6); + EXPECT_NEAR(0.84, productData.backEmissivity.value(), 1e-6); + EXPECT_EQ(102, productData.nfrcid.value()); + EXPECT_EQ("Generic Clear Glass", productData.productName); + EXPECT_EQ("glazing", productData.productType); + EXPECT_EQ("Monolithic", productData.productSubtype); std::vector correctResults{{0.300, 0.0020, 0.0470, 0.0480}, {0.305, 0.0030, 0.0470, 0.0480}, {0.310, 0.0090, 0.0470, 0.0480}, @@ -107,7 +107,7 @@ TEST_F(TestFile1, TestParseFile) {0.325, 0.2180, 0.0490, 0.0500}}; auto & givenResults = - std::get>(productData->measurements.value()); + std::get>(productData.measurements.value()); EXPECT_EQ(correctResults.size(), givenResults.size()); for(auto i = 0u; i < correctResults.size(); ++i) { diff --git a/test/InputInvertedEmissivities.unit.cpp b/test/InputInvertedEmissivities.unit.cpp index 0b86f75..0fa0f7f 100644 --- a/test/InputInvertedEmissivities.unit.cpp +++ b/test/InputInvertedEmissivities.unit.cpp @@ -48,17 +48,17 @@ TEST_F(TestInvertedEmissivities, Test1) { const std::string inputFile = R"(InputInvertedEmissivites.dat)"; OpticsParser::Parser parser; - std::shared_ptr product = parser.parseFile(inputFile); + auto product = parser.parseFile(inputFile); - EXPECT_NEAR(3.048, product->thickness.value(), 1e-6); - EXPECT_NEAR(1, product->conductivity.value(), 1e-6); - EXPECT_NEAR(0, product->IRTransmittance.value(), 1e-6); - EXPECT_NEAR(0.84, product->frontEmissivity.value(), 1e-6); - EXPECT_NEAR(0.5, product->backEmissivity.value(), 1e-6); - EXPECT_EQ(102, product->nfrcid.value()); - EXPECT_EQ("", product->productName); - EXPECT_EQ("glazing", product->productType); - EXPECT_EQ("Monolithic", product->productSubtype); + EXPECT_NEAR(3.048, product.thickness.value(), 1e-6); + EXPECT_NEAR(1, product.conductivity.value(), 1e-6); + EXPECT_NEAR(0, product.IRTransmittance.value(), 1e-6); + EXPECT_NEAR(0.84, product.frontEmissivity.value(), 1e-6); + EXPECT_NEAR(0.5, product.backEmissivity.value(), 1e-6); + EXPECT_EQ(102, product.nfrcid.value()); + EXPECT_EQ("", product.productName); + EXPECT_EQ("glazing", product.productType); + EXPECT_EQ("Monolithic", product.productSubtype); std::vector correctResults{{0.300, 0.0020, 0.0470, 0.0480}, {0.305, 0.0030, 0.0470, 0.0480}, @@ -68,7 +68,7 @@ TEST_F(TestInvertedEmissivities, Test1) {0.325, 0.2180, 0.0490, 0.0500}}; auto & givenResults = - std::get>(product->measurements.value()); + std::get>(product.measurements.value()); EXPECT_EQ(correctResults.size(), givenResults.size()); for(auto i = 0u; i < correctResults.size(); ++i) { diff --git a/test/convert_optics_to_json.unit.cpp b/test/convert_optics_to_json.unit.cpp index 59c30d3..f3e67fc 100644 --- a/test/convert_optics_to_json.unit.cpp +++ b/test/convert_optics_to_json.unit.cpp @@ -31,7 +31,7 @@ TEST_F(TestConvertOpticsFile, TestConvertClear3) clear_3_path += "/CLEAR_3.DAT"; OpticsParser::Parser parser; - std::shared_ptr product = parser.parseFile(clear_3_path); + auto product = parser.parseFile(clear_3_path); nlohmann::json product_json = *product; EXPECT_EQ(product_json.at("nfrc_id").get(), 102); @@ -66,8 +66,8 @@ TEST_F(TestConvertOpticsFile, TestConvertClear3) EXPECT_EQ(measurements[110].at("rb").get(), 0.068); /* - EXPECT_EQ(product->frontEmissivitySource.value(), "Material"); - EXPECT_EQ(product->backEmissivitySource.value(), "Material"); + EXPECT_EQ(product.frontEmissivitySource.value(), "Material"); + EXPECT_EQ(product.backEmissivitySource.value(), "Material"); */ EXPECT_EQ(product_json.at("manufacturer").get(), "Generic"); diff --git a/test/read_bsdf_xml_file.unit.cpp b/test/read_bsdf_xml_file.unit.cpp index 4143d3c..3d28416 100644 --- a/test/read_bsdf_xml_file.unit.cpp +++ b/test/read_bsdf_xml_file.unit.cpp @@ -25,21 +25,21 @@ TEST_F(TestLoadBSDFXMLFromDisk, TestLoad2011SA1) product_path /= "products"; product_path /= "2011-SA1.XML"; - std::shared_ptr product = + auto product = OpticsParser::parseBSDFXMLFile(product_path.string()); - // EXPECT_EQ(product->nfrcid.value(), 102); - EXPECT_EQ(product->productName, "Satine 5500 5%, White Pearl"); - EXPECT_EQ(product->productType, ""); - EXPECT_EQ(product->manufacturer, "Nysan"); - EXPECT_EQ(product->thickness, 1); - EXPECT_EQ(product->conductivity, .15); - EXPECT_EQ(product->IRTransmittance, 0.10916); - EXPECT_EQ(product->frontEmissivity, 0.79626); - EXPECT_EQ(product->backEmissivity, 0.79626); - EXPECT_TRUE(product->measurements.has_value()); - EXPECT_TRUE(std::holds_alternative(product->measurements.value())); - auto & measurements = std::get(product->measurements.value()); + // EXPECT_EQ(product.nfrcid.value(), 102); + EXPECT_EQ(product.productName, "Satine 5500 5%, White Pearl"); + EXPECT_EQ(product.productType, ""); + EXPECT_EQ(product.manufacturer, "Nysan"); + EXPECT_EQ(product.thickness, 1); + EXPECT_EQ(product.conductivity, .15); + EXPECT_EQ(product.IRTransmittance, 0.10916); + EXPECT_EQ(product.frontEmissivity, 0.79626); + EXPECT_EQ(product.backEmissivity, 0.79626); + EXPECT_TRUE(product.measurements.has_value()); + EXPECT_TRUE(std::holds_alternative(product.measurements.value())); + auto & measurements = std::get(product.measurements.value()); auto & solar = measurements.solar; auto & visible = measurements.visible; EXPECT_EQ(solar.tf.rowAngleBasisName, "LBNL/Klems Full"); diff --git a/test/read_igsdb_shading_layer_json.unit.cpp b/test/read_igsdb_shading_layer_json.unit.cpp index 7b15bd5..1ddd9a4 100644 --- a/test/read_igsdb_shading_layer_json.unit.cpp +++ b/test/read_igsdb_shading_layer_json.unit.cpp @@ -28,27 +28,25 @@ TEST_F(TestLoadIGSDBJSONFromDisk, TestLoadIGSDBVenetianShadingLayerJSON) OpticsParser::Parser parser; - std::shared_ptr product = - std::dynamic_pointer_cast( - parser.parseJSONFile(product_path.string())); + auto product = parser.parseJSONFile(product_path.string()); - // EXPECT_EQ(product->nfrcid.value(), 102); - EXPECT_EQ(product->productName.value(), "Slim White Venetian Blind"); - EXPECT_EQ(product->productType, "shading"); - EXPECT_EQ(product->manufacturer, "Pella"); - EXPECT_EQ(product->thickness, std::optional()); - // TODO EXPECT_EQ(product->conductivity, 1.0); - EXPECT_EQ(product->IRTransmittance, std::optional()); - EXPECT_EQ(product->frontEmissivity, std::optional()); - EXPECT_EQ(product->backEmissivity, std::optional()); - EXPECT_EQ(product->measurements.has_value(), false); + // EXPECT_EQ(product.nfrcid.value(), 102); + EXPECT_EQ(product.productName.value(), "Slim White Venetian Blind"); + EXPECT_EQ(product.productType, "shading"); + EXPECT_EQ(product.manufacturer, "Pella"); + EXPECT_EQ(product.thickness, std::optional()); + // TODO EXPECT_EQ(product.conductivity, 1.0); + EXPECT_EQ(product.IRTransmittance, std::optional()); + EXPECT_EQ(product.frontEmissivity, std::optional()); + EXPECT_EQ(product.backEmissivity, std::optional()); + EXPECT_EQ(product.measurements.has_value(), false); auto geometry = std::dynamic_pointer_cast( - product->compositionInformation->geometry); + product.composition.value().geometry); EXPECT_EQ(geometry->slatWidth, 14.8); EXPECT_EQ(geometry->slatSpacing, 12.7); EXPECT_EQ(geometry->slatCurvature, 33.13057); EXPECT_EQ(geometry->numberSegments, 5); - auto material = product->compositionInformation->material; + auto material = product.composition.value().material; EXPECT_EQ(material->productName.value(), "White Venetian Blind Slat"); EXPECT_EQ(material->productType, "material"); EXPECT_EQ(material->manufacturer, "Pella"); @@ -79,29 +77,26 @@ TEST_F(TestLoadIGSDBJSONFromDisk, TestLoadIGSDBPerforatedScreenShadingLayerJSON) OpticsParser::Parser parser; + auto product = parser.parseJSONFile(product_path.string()); - std::shared_ptr product = - std::dynamic_pointer_cast( - parser.parseJSONFile(product_path.string())); - - // EXPECT_EQ(product->nfrcid.value(), 102); - EXPECT_EQ(product->name, "Solar Comfort Radiant Barrier"); - EXPECT_EQ(product->productType, "shading"); - EXPECT_EQ(product->manufacturer, "Solar Comfort"); - EXPECT_EQ(product->thickness, std::optional()); - // TODO EXPECT_EQ(product->conductivity, 1.0); - EXPECT_EQ(product->IRTransmittance, std::optional()); - EXPECT_EQ(product->frontEmissivity, std::optional()); - EXPECT_EQ(product->backEmissivity, std::optional()); - EXPECT_EQ(product->measurements.has_value(), false); + // EXPECT_EQ(product.nfrcid.value(), 102); + EXPECT_EQ(product.name, "Solar Comfort Radiant Barrier"); + EXPECT_EQ(product.productType, "shading"); + EXPECT_EQ(product.manufacturer, "Solar Comfort"); + EXPECT_EQ(product.thickness, std::optional()); + // TODO EXPECT_EQ(product.conductivity, 1.0); + EXPECT_EQ(product.IRTransmittance, std::optional()); + EXPECT_EQ(product.frontEmissivity, std::optional()); + EXPECT_EQ(product.backEmissivity, std::optional()); + EXPECT_EQ(product.measurements.has_value(), false); auto geometry = std::dynamic_pointer_cast( - product->compositionInformation->geometry); + product.composition.value().geometry); EXPECT_EQ(geometry->spacingX, 1.69); EXPECT_EQ(geometry->spacingY, 1.69); EXPECT_EQ(geometry->dimensionX, 0.58); EXPECT_EQ(geometry->dimensionY, 6.35); EXPECT_EQ(geometry->perforationType, "Circular"); - auto material = product->compositionInformation->material; + auto material = product.composition.value().material; EXPECT_EQ(material->name, "SCRadiantBarrier.txt"); EXPECT_EQ(material->productType, "material"); EXPECT_EQ(material->manufacturer, "Solar Comfort"); diff --git a/test/read_json_file_from_disk.unit.cpp b/test/read_json_file_from_disk.unit.cpp index 5dc0138..0bd4d10 100644 --- a/test/read_json_file_from_disk.unit.cpp +++ b/test/read_json_file_from_disk.unit.cpp @@ -27,17 +27,17 @@ TEST_F(TestLoadJSONFromDisk, TestLoadClear3JSON) clear_3_path /= "products"; clear_3_path /= "igsdb_v1_clear_3.json"; - std::shared_ptr product = OpticsParser::parseJSONFile(clear_3_path.string()); - // EXPECT_EQ(product->nfrcid.value(), 102); - EXPECT_EQ(product->name, "Generic Clear Glass"); - EXPECT_EQ(product->productType, "glazing"); - EXPECT_EQ(product->productSubtype, "monolithic"); - EXPECT_NEAR(product->thickness.value(), 3.048, 1e-6); - EXPECT_EQ(product->conductivity, 1.0); - EXPECT_EQ(product->IRTransmittance.value(), 0.0); - EXPECT_NEAR(product->frontEmissivity.value(), 0.84, 1e-6); - EXPECT_NEAR(product->backEmissivity.value(), 0.84, 1e-6); - auto & measurements = std::get>(product->measurements.value()); + auto product = OpticsParser::parseJSONFile(clear_3_path.string()); + // EXPECT_EQ(product.nfrcid.value(), 102); + EXPECT_EQ(product.name, "Generic Clear Glass"); + EXPECT_EQ(product.productType, "glazing"); + EXPECT_EQ(product.productSubtype, "monolithic"); + EXPECT_NEAR(product.thickness.value(), 3.048, 1e-6); + EXPECT_EQ(product.conductivity, 1.0); + EXPECT_EQ(product.IRTransmittance.value(), 0.0); + EXPECT_NEAR(product.frontEmissivity.value(), 0.84, 1e-6); + EXPECT_NEAR(product.backEmissivity.value(), 0.84, 1e-6); + auto & measurements = std::get>(product.measurements.value()); EXPECT_EQ(measurements.size(), 111); EXPECT_NEAR(measurements[0].wavelength, 0.3, 1e-6); EXPECT_NEAR(measurements[0].directComponent.value().tf, 0.002, 1e-6); @@ -60,17 +60,17 @@ TEST_F(TestLoadJSONFromDisk, TestLoadClear3IGSDBV2JSON) clear_3_path /= "products"; clear_3_path /= "igsdb_v2_clear_3.json"; - std::shared_ptr product = OpticsParser::parseJSONFile(clear_3_path.string()); - // EXPECT_EQ(product->nfrcid.value(), 102); - EXPECT_EQ(product->name, "Generic Clear Glass"); - EXPECT_EQ(product->productType, "GLAZING"); - EXPECT_EQ(product->productSubtype, "MONOLITHIC"); - EXPECT_NEAR(product->thickness.value(), 3.048, 1e-6); - EXPECT_EQ(product->conductivity, std::optional()); - EXPECT_EQ(product->IRTransmittance.value(), 0.0); - EXPECT_NEAR(product->frontEmissivity.value(), 0.84, 1e-6); - EXPECT_NEAR(product->backEmissivity.value(), 0.84, 1e-6); - auto & measurements = std::get>(product->measurements.value()); + auto product = OpticsParser::parseJSONFile(clear_3_path.string()); + // EXPECT_EQ(product.nfrcid.value(), 102); + EXPECT_EQ(product.name, "Generic Clear Glass"); + EXPECT_EQ(product.productType, "GLAZING"); + EXPECT_EQ(product.productSubtype, "MONOLITHIC"); + EXPECT_NEAR(product.thickness.value(), 3.048, 1e-6); + EXPECT_EQ(product.conductivity, std::optional()); + EXPECT_EQ(product.IRTransmittance.value(), 0.0); + EXPECT_NEAR(product.frontEmissivity.value(), 0.84, 1e-6); + EXPECT_NEAR(product.backEmissivity.value(), 0.84, 1e-6); + auto & measurements = std::get>(product.measurements.value()); EXPECT_EQ(measurements.size(), 111); EXPECT_NEAR(measurements[0].wavelength, 0.3, 1e-6); EXPECT_NEAR(measurements[0].directComponent.value().tf, 0.002, 1e-6); @@ -90,17 +90,17 @@ TEST_F(TestLoadJSONFromDisk, TestLoadPVIGSDBV2JSON) product_path /= "products"; product_path /= "generic_pv.json"; - std::shared_ptr product = OpticsParser::parseJSONFile(product_path.string()); - // EXPECT_EQ(product->nfrcid.value(), 102); - EXPECT_EQ(product->name, "Generic PV"); - EXPECT_EQ(product->productType, "GLAZING"); - EXPECT_EQ(product->productSubtype, "MONOLITHIC"); - EXPECT_NEAR(product->thickness.value(), 3.048, 1e-6); - EXPECT_EQ(product->conductivity.value(), 1.0); - EXPECT_EQ(product->IRTransmittance.value(), 0.0); - EXPECT_NEAR(product->frontEmissivity.value(), 0.84, 1e-6); - EXPECT_NEAR(product->backEmissivity.value(), 0.84, 1e-6); - auto & measurements = std::get>(product->measurements.value()); + auto product = OpticsParser::parseJSONFile(product_path.string()); + // EXPECT_EQ(product.nfrcid.value(), 102); + EXPECT_EQ(product.name, "Generic PV"); + EXPECT_EQ(product.productType, "GLAZING"); + EXPECT_EQ(product.productSubtype, "MONOLITHIC"); + EXPECT_NEAR(product.thickness.value(), 3.048, 1e-6); + EXPECT_EQ(product.conductivity.value(), 1.0); + EXPECT_EQ(product.IRTransmittance.value(), 0.0); + EXPECT_NEAR(product.frontEmissivity.value(), 0.84, 1e-6); + EXPECT_NEAR(product.backEmissivity.value(), 0.84, 1e-6); + auto & measurements = std::get>(product.measurements.value()); EXPECT_EQ(measurements.size(), 441); EXPECT_NEAR(measurements[0].wavelength, 0.3, 1e-6); EXPECT_NEAR(measurements[0].directComponent.value().tf, 0.2, 1e-6); @@ -124,7 +124,7 @@ TEST_F(TestLoadJSONFromDisk, TestLoadPVIGSDBV2JSON) EXPECT_NEAR(measurements[440].pvComponent.value().eqef, 0.0, 1e-6); EXPECT_NEAR(measurements[440].pvComponent.value().eqeb, 0.0, 1e-6); - auto & allPowerProperties = product->pvPowerProperties.value(); + auto & allPowerProperties = product.pvPowerProperties.value(); EXPECT_EQ(allPowerProperties.size(), 1); auto & powerProperties = allPowerProperties.at(298.15); EXPECT_EQ(powerProperties.size(), 400); diff --git a/test/read_optics_file_from_disk.unit.cpp b/test/read_optics_file_from_disk.unit.cpp index 99985d2..66ea860 100644 --- a/test/read_optics_file_from_disk.unit.cpp +++ b/test/read_optics_file_from_disk.unit.cpp @@ -28,18 +28,18 @@ TEST_F(TestLoadOpticsFileFromDisk, TestLoadClear3) clear_3_path += "/CLEAR_3.DAT"; OpticsParser::Parser parser; - std::shared_ptr product = parser.parseFile(clear_3_path); - EXPECT_EQ(product->nfrcid.value(), 102); - EXPECT_EQ(product->productName, "Generic Clear Glass"); - EXPECT_EQ("glazing", product->productType); - EXPECT_EQ("Monolithic", product->productSubtype); - EXPECT_EQ(product->thickness.value(), 3.048); - EXPECT_EQ(product->conductivity, 1.0); - EXPECT_EQ(product->IRTransmittance.value(), 0.0); - EXPECT_EQ(product->frontEmissivity.value(), 0.84); - EXPECT_EQ(product->backEmissivity.value(), 0.84); + auto product = parser.parseFile(clear_3_path); + EXPECT_EQ(product.nfrcid.value(), 102); + EXPECT_EQ(product.productName, "Generic Clear Glass"); + EXPECT_EQ("glazing", product.productType); + EXPECT_EQ("Monolithic", product.productSubtype); + EXPECT_EQ(product.thickness.value(), 3.048); + EXPECT_EQ(product.conductivity, 1.0); + EXPECT_EQ(product.IRTransmittance.value(), 0.0); + EXPECT_EQ(product.frontEmissivity.value(), 0.84); + EXPECT_EQ(product.backEmissivity.value(), 0.84); auto & givenResults = - std::get>(product->measurements.value()); + std::get>(product.measurements.value()); EXPECT_EQ(givenResults.size(), 111); EXPECT_EQ(givenResults[0].wavelength, 0.3); EXPECT_EQ(givenResults[0].directComponent.value().tf, 0.002); @@ -49,17 +49,17 @@ TEST_F(TestLoadOpticsFileFromDisk, TestLoadClear3) EXPECT_EQ(givenResults[110].directComponent.value().tf, 0.822); EXPECT_EQ(givenResults[110].directComponent.value().rf, 0.068); EXPECT_EQ(givenResults[110].directComponent.value().rb, 0.068); - EXPECT_EQ(product->frontEmissivitySource.value(), "Material"); - EXPECT_EQ(product->backEmissivitySource.value(), "Material"); - EXPECT_EQ(product->manufacturer, "Generic"); - EXPECT_EQ(product->material, "Glass"); - EXPECT_EQ(product->coatingName, "N/A"); - EXPECT_EQ(product->coatedSide, "Neither"); - EXPECT_EQ(product->substrateFilename, "N/A"); - EXPECT_EQ(product->appearance, "Clear"); - EXPECT_EQ(product->acceptance, "#"); - EXPECT_EQ(product->unitSystem, "SI"); - EXPECT_EQ(product->wavelengthUnit, "Microns"); + EXPECT_EQ(product.frontEmissivitySource.value(), "Material"); + EXPECT_EQ(product.backEmissivitySource.value(), "Material"); + EXPECT_EQ(product.manufacturer, "Generic"); + EXPECT_EQ(product.material, "Glass"); + EXPECT_EQ(product.coatingName, "N/A"); + EXPECT_EQ(product.coatedSide, "Neither"); + EXPECT_EQ(product.substrateFilename, "N/A"); + EXPECT_EQ(product.appearance, "Clear"); + EXPECT_EQ(product.acceptance, "#"); + EXPECT_EQ(product.unitSystem, "SI"); + EXPECT_EQ(product.wavelengthUnit, "Microns"); } TEST_F(TestLoadOpticsFileFromDisk, TestLoadDiffuseData) @@ -71,18 +71,18 @@ TEST_F(TestLoadOpticsFileFromDisk, TestLoadDiffuseData) product_path += "/diffuse_optics_file_2.txt"; OpticsParser::Parser parser; - std::shared_ptr product = parser.parseFile(product_path); - EXPECT_EQ(product->nfrcid, std::optional()); - EXPECT_EQ(product->productName, "Generic frit 38mm aperture"); - EXPECT_EQ("glazing", product->productType); - EXPECT_EQ("Coated", product->productSubtype); - EXPECT_EQ(product->thickness.value(), 6.0); - EXPECT_EQ(product->conductivity, 1.0); - EXPECT_EQ(product->IRTransmittance.value(), 0.0); - EXPECT_EQ(product->frontEmissivity.value(), 0.86); - EXPECT_EQ(product->backEmissivity.value(), 0.86); + auto product = parser.parseFile(product_path); + EXPECT_EQ(product.nfrcid, std::optional()); + EXPECT_EQ(product.productName, "Generic frit 38mm aperture"); + EXPECT_EQ("glazing", product.productType); + EXPECT_EQ("Coated", product.productSubtype); + EXPECT_EQ(product.thickness.value(), 6.0); + EXPECT_EQ(product.conductivity, 1.0); + EXPECT_EQ(product.IRTransmittance.value(), 0.0); + EXPECT_EQ(product.frontEmissivity.value(), 0.86); + EXPECT_EQ(product.backEmissivity.value(), 0.86); auto & givenMeasurements = - std::get>(product->measurements.value()); + std::get>(product.measurements.value()); EXPECT_EQ(givenMeasurements.size(), 451); EXPECT_EQ(givenMeasurements[0].wavelength, 0.250); EXPECT_EQ(givenMeasurements[0].directComponent.value().tf, 0.001); @@ -102,16 +102,16 @@ TEST_F(TestLoadOpticsFileFromDisk, TestLoadDiffuseData) EXPECT_EQ(givenMeasurements[450].diffuseComponent.value().tb, 0.240); EXPECT_EQ(givenMeasurements[450].diffuseComponent.value().rf, 0.0970); EXPECT_EQ(givenMeasurements[450].diffuseComponent.value().rb, 0.0940); - EXPECT_EQ(product->frontEmissivitySource, std::optional()); - EXPECT_EQ(product->backEmissivitySource, std::optional()); - EXPECT_EQ(product->manufacturer, "LBNL demo"); - EXPECT_EQ(product->material, std::optional()); - EXPECT_EQ(product->coatingName, "Generic clear frit"); - EXPECT_EQ(product->coatedSide, "Back"); - EXPECT_EQ(product->substrateFilename, "CLEAR_6.DAT"); - EXPECT_EQ(product->appearance, "Hazy"); - EXPECT_EQ(product->acceptance, std::optional()); - EXPECT_EQ(product->unitSystem, "SI"); - EXPECT_EQ(product->wavelengthUnit, "Microns"); - EXPECT_EQ(product->permeabilityFactor, 0.0); + EXPECT_EQ(product.frontEmissivitySource, std::optional()); + EXPECT_EQ(product.backEmissivitySource, std::optional()); + EXPECT_EQ(product.manufacturer, "LBNL demo"); + EXPECT_EQ(product.material, std::optional()); + EXPECT_EQ(product.coatingName, "Generic clear frit"); + EXPECT_EQ(product.coatedSide, "Back"); + EXPECT_EQ(product.substrateFilename, "CLEAR_6.DAT"); + EXPECT_EQ(product.appearance, "Hazy"); + EXPECT_EQ(product.acceptance, std::optional()); + EXPECT_EQ(product.unitSystem, "SI"); + EXPECT_EQ(product.wavelengthUnit, "Microns"); + EXPECT_EQ(product.permeabilityFactor, 0.0); } \ No newline at end of file