Skip to content

Commit

Permalink
Renamed test results and products for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenCzarnecki committed Dec 18, 2024
1 parent 1781192 commit 9e49690
Show file tree
Hide file tree
Showing 259 changed files with 6,433 additions and 1,228 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using namespace wincalc;
using namespace window_standards;


class Test_1_layer_CS03_genBSDF : public testing::Test
class Test_1_layer_cellular_shade_CS03_genBSDF : public testing::Test
{
protected:
std::shared_ptr<Glazing_System> glazing_system_u;
Expand Down Expand Up @@ -50,7 +50,7 @@ class Test_1_layer_CS03_genBSDF : public testing::Test
}
};

TEST_F(Test_1_layer_CS03_genBSDF, Test_Thermal)
TEST_F(Test_1_layer_cellular_shade_CS03_genBSDF, Test_Thermal)
{
// The genBSDF XML files do not have conductivity and so cannot generate thermal results
EXPECT_THROW(glazing_system_u->gap_layers_effective_conductivities(Tarcog::ISO15099::System::Uvalue), std::runtime_error);
Expand All @@ -68,7 +68,7 @@ TEST_F(Test_1_layer_CS03_genBSDF, Test_Thermal)

}

TEST_F(Test_1_layer_CS03_genBSDF, Test_Optical)
TEST_F(Test_1_layer_cellular_shade_CS03_genBSDF, Test_Optical)
{
test_optical_results("1_layer/CS03_genBSDF/full_basis", glazing_system_u, update_results);
test_optical_results("1_layer/cellular_shade_CS03_genBSDF/full_basis", glazing_system_u, update_results);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Test_1_layer_genBSDF_cgdb_24040 : public testing::Test
std::filesystem::path product_path(test_dir);
product_path /= "products";
product_path /=
"CS03_genBSDF.xml"; //"cgdb_24040_Intigral_SL_Vanity_C000_White_Pleated_Shade_20mm_genBSDF.xml";
"cgdb_24040_Intigral_SL_Vanity_C000_White_Pleated_Shade_20mm_genBSDF.xml";

std::vector<OpticsParser::ProductData> products;
auto shade = OpticsParser::parseBSDFXMLFile(product_path.string());
Expand Down Expand Up @@ -71,5 +71,5 @@ TEST_F(Test_1_layer_genBSDF_cgdb_24040, Test_Thermal)

TEST_F(Test_1_layer_genBSDF_cgdb_24040, Test_Optical)
{
test_optical_results("1_layer/genBSDF_cgdb_24040/full_basis", glazing_system_u, update_results);
test_optical_results("1_layer/pleated_shade_genBSDF_cgdb_24040/full_basis", glazing_system_u, update_results);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Test_1_layer_bsdf_xml_cgdb_14060 : public testing::Test
{
std::filesystem::path shade_path(test_dir);
shade_path /= "products";
shade_path /= "cgdb_14060_Urban Loft River Stone.xml";
shade_path /= "cgdb_14060 Urban Loft River Stone.xml";

std::vector<OpticsParser::ProductData> parsed_products;
auto shade = OpticsParser::parseBSDFXMLFile(shade_path.string());
Expand All @@ -51,13 +51,13 @@ class Test_1_layer_bsdf_xml_cgdb_14060 : public testing::Test

TEST_F(Test_1_layer_bsdf_xml_cgdb_14060, Test_Optical)
{
test_optical_results("1_layer/bsdf_xml_cgdb_14060/full_basis", glazing_system_u, update_results);
test_optical_results("1_layer/roller_shade_bsdf_xml_cgdb_14060/full_basis", glazing_system_u, update_results);
}

TEST_F(Test_1_layer_bsdf_xml_cgdb_14060, Test_Thermal)
{
test_thermal_results("1_layer/bsdf_xml_cgdb_14060/full_basis", "thermal_U_Environment", glazing_system_u, update_results);
test_thermal_results("1_layer/bsdf_xml_cgdb_14060/full_basis", "thermal_SHGC_Environment", glazing_system_shgc, update_results);
test_thermal_results("1_layer/roller_shade_bsdf_xml_cgdb_14060/full_basis", "thermal_U_Environment", glazing_system_u, update_results);
test_thermal_results("1_layer/roller_shade_bsdf_xml_cgdb_14060/full_basis", "thermal_SHGC_Environment", glazing_system_shgc, update_results);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Test_1_layer_bsdf_xml_cgdb_46016 : public testing::Test
{
std::filesystem::path shade_path(test_dir);
shade_path /= "products";
shade_path /= "cgdb 46016 SEATEX Midnight.xml";
shade_path /= "cgdb_46016 SEATEX Midnight.xml";

std::vector<OpticsParser::ProductData> parsed_products;
auto shade = OpticsParser::parseBSDFXMLFile(shade_path.string());
Expand All @@ -51,13 +51,13 @@ class Test_1_layer_bsdf_xml_cgdb_46016 : public testing::Test

TEST_F(Test_1_layer_bsdf_xml_cgdb_46016, Test_Optical)
{
test_optical_results("1_layer/bsdf_xml_cgdb_46016/full_basis", glazing_system_u, update_results);
test_optical_results("1_layer/roller_shade_bsdf_xml_cgdb_46016/full_basis", glazing_system_u, update_results);
}

TEST_F(Test_1_layer_bsdf_xml_cgdb_46016, Test_Thermal)
{
test_thermal_results("1_layer/bsdf_xml_cgdb_46016/full_basis", "thermal_U_Environment", glazing_system_u, update_results);
test_thermal_results("1_layer/bsdf_xml_cgdb_46016/full_basis", "thermal_SHGC_Environment", glazing_system_shgc, update_results);
test_thermal_results("1_layer/roller_shade_bsdf_xml_cgdb_46016/full_basis", "thermal_U_Environment", glazing_system_u, update_results);
test_thermal_results("1_layer/roller_shade_bsdf_xml_cgdb_46016/full_basis", "thermal_SHGC_Environment", glazing_system_shgc, update_results);
}


Expand Down
75 changes: 75 additions & 0 deletions test/1_layer_roman_shade_genBSDF.unit.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#include <memory>
#include <gtest/gtest.h>
#include <cstdlib>
#include <memory>
#include <iostream>
#include <filesystem>
#include <fstream>

#include "wincalc/wincalc.h"
#include "optical_calcs.h"
#include "util.h"
#include "convert_optics_parser.h"
#include "paths.h"


using namespace wincalc;
using namespace window_standards;


class Test_1_layer_roman_shade_genBSDF_FlatFold : public testing::Test
{
protected:
std::shared_ptr<Glazing_System> glazing_system_u;
std::shared_ptr<Glazing_System> glazing_system_shgc;

virtual void SetUp()
{
std::filesystem::path product_path(test_dir);
product_path /= "products";
product_path /=
"roman_shade_FlatFoldTHM-2_GenBSDF.xml"; //"cgdb_24040_Intigral_SL_Vanity_C000_White_Pleated_Shade_20mm_genBSDF.xml";

std::vector<OpticsParser::ProductData> products;
auto shade = OpticsParser::parseBSDFXMLFile(product_path.string());
products.push_back(shade);

std::vector<std::shared_ptr<Tarcog::ISO15099::CIGUGapLayer>> gaps;

std::filesystem::path standard_path(test_dir);
standard_path /= "standards";
standard_path /= "W5_NFRC_2003.std";
Optical_Standard standard = load_optical_standard(standard_path.string());

auto bsdf_hemisphere =
SingleLayerOptics::BSDFHemisphere::create(SingleLayerOptics::BSDFBasis::Full);

glazing_system_u = std::make_shared<Glazing_System>(
standard, products, gaps, 1.0, 1.0, 90, nfrc_u_environments(), bsdf_hemisphere);
glazing_system_shgc = std::make_shared<Glazing_System>(
standard, products, gaps, 1.0, 1.0, 90, nfrc_shgc_environments(), bsdf_hemisphere);
}
};

TEST_F(Test_1_layer_roman_shade_genBSDF_FlatFold, Test_Thermal)
{
// The genBSDF XML files do not have conductivity and so cannot generate thermal results
EXPECT_THROW(glazing_system_u->gap_layers_effective_conductivities(Tarcog::ISO15099::System::Uvalue), std::runtime_error);
EXPECT_THROW(glazing_system_u->gap_layers_effective_conductivities(Tarcog::ISO15099::System::SHGC), std::runtime_error);
EXPECT_THROW(glazing_system_u->layer_temperatures(Tarcog::ISO15099::System::Uvalue), std::runtime_error);
EXPECT_THROW(glazing_system_u->layer_temperatures(Tarcog::ISO15099::System::SHGC), std::runtime_error);
EXPECT_THROW(glazing_system_u->relative_heat_gain(), std::runtime_error);
EXPECT_THROW(glazing_system_u->shgc(), std::runtime_error);
EXPECT_THROW(glazing_system_u->u(), std::runtime_error);
EXPECT_THROW(glazing_system_u->solid_layers_effective_conductivities(Tarcog::ISO15099::System::Uvalue), std::runtime_error);
EXPECT_THROW(glazing_system_u->solid_layers_effective_conductivities(Tarcog::ISO15099::System::SHGC), std::runtime_error);
EXPECT_THROW(glazing_system_u->system_effective_conductivity(Tarcog::ISO15099::System::Uvalue), std::runtime_error);
EXPECT_THROW(glazing_system_u->system_effective_conductivity(Tarcog::ISO15099::System::SHGC), std::runtime_error);


}

TEST_F(Test_1_layer_roman_shade_genBSDF_FlatFold, Test_Optical)
{
test_optical_results("1_layer/roman_shade_genBSDF_FlatFold/full_basis", glazing_system_u, update_results);
}
20 changes: 10 additions & 10 deletions test/2_layers_nfrc_102_air_nfrc_102_deflection.unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class Test_2_layers_nfrc_102_air_nfrc_102_deflection : public testing::Test

TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection, Test_Deflection_Off)
{
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/deflection_off",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection",
"deflection_off",
glazing_system_u,
Tarcog::ISO15099::System::Uvalue,
update_results);
Expand All @@ -63,29 +63,29 @@ TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection, Test_Deflection_On)
{
glazing_system_u->enable_deflection(true);

test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/deflection_on_winter_u_run",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection",
"deflection_on_winter_u_run",
glazing_system_u,
Tarcog::ISO15099::System::Uvalue,
update_results);

glazing_system_u->enable_deflection(true);

test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/deflection_on_winter_shgc_run",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection",
"deflection_on_winter_shgc_run",
glazing_system_u,
Tarcog::ISO15099::System::SHGC,
update_results);

glazing_system_shgc->enable_deflection(true);

test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/deflection_on_summer_u_run",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection",
"deflection_on_summer_u_run",
glazing_system_shgc,
Tarcog::ISO15099::System::Uvalue,
update_results);
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/deflection_on_summer_shgc_run",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection",
"deflection_on_summer_shgc_run",
glazing_system_shgc,
Tarcog::ISO15099::System::SHGC,
update_results);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class Test_2_layers_nfrc_102_air_nfrc_102_deflection_density : public testing::T

TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_density, Test_Deflection_Off)
{
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/density/deflection_off",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/density",
"deflection_off",
glazing_system,
Tarcog::ISO15099::System::Uvalue,
update_results);
Expand All @@ -63,8 +63,8 @@ TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_density, Test_Deflection_O
TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_density, Test_Deflection_On)
{
glazing_system->enable_deflection(true);
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/density/deflection_on",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/density",
"deflection_on",
glazing_system,
Tarcog::ISO15099::System::Uvalue,
update_results);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class Test_2_layers_nfrc_102_air_nfrc_102_deflection_environment : public testin

TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_environment, Test_Deflection_Off)
{
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/environment/deflection_off",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/environment",
"deflection_off",
glazing_system,
Tarcog::ISO15099::System::SHGC,
update_results);
Expand All @@ -62,8 +62,8 @@ TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_environment, Test_Deflecti
TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_environment, Test_Deflection_On)
{
glazing_system->enable_deflection(true);
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/environment/deflection_on_environment_1",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/environment",
"deflection_on_environment_1",
glazing_system,
Tarcog::ISO15099::System::SHGC,
update_results);
Expand All @@ -73,8 +73,8 @@ TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_environment, Test_Deflecti
new_env.outside.pressure = 110000;
glazing_system->environments(new_env);

test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/environment/deflection_on_environment_2",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/environment",
"deflection_on_environment_2",
glazing_system,
Tarcog::ISO15099::System::SHGC,
update_results);
Expand Down
12 changes: 6 additions & 6 deletions test/2_layers_nfrc_102_air_nfrc_102_deflection_load.unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_load, Test_Deflection_Off)
// test to make sure nothing affects results with deflection turned off.
// test is not completed, need to test other results later.
glazing_system->set_applied_loads({12, 23});
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/applied_loads/deflection_off",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/applied_loads",
"deflection_off",
glazing_system,
Tarcog::ISO15099::System::Uvalue,
update_results);
Expand All @@ -67,15 +67,15 @@ TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_load, Test_Deflection_On)
glazing_system->enable_deflection(true);
glazing_system->set_applied_loads({12, 23});

test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/applied_loads/deflection_on_applied_loads_1",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/applied_loads",
"deflection_on_applied_loads_1",
glazing_system,
Tarcog::ISO15099::System::Uvalue,
update_results);
// change applied loads, make sure results change
glazing_system->set_applied_loads({1, 1000});
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/applied_loads/deflection_on_applied_loads_2",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/applied_loads",
"deflection_on_applied_loads_2",
glazing_system,
Tarcog::ISO15099::System::Uvalue,
update_results);
Expand Down
12 changes: 6 additions & 6 deletions test/2_layers_nfrc_102_air_nfrc_102_deflection_tilt.unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class Test_2_layers_nfrc_102_air_nfrc_102_deflection_tilt : public testing::Test

TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_tilt, Test_Deflection_Off)
{
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/tilt/deflection_off",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/tilt",
"deflection_off",
glazing_system,
Tarcog::ISO15099::System::Uvalue,
update_results);
Expand All @@ -62,16 +62,16 @@ TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_tilt, Test_Deflection_Off)
TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_tilt, Test_Deflection_On)
{
glazing_system->enable_deflection(true);
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/tilt/deflection_on_tilt_1",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/tilt",
"deflection_on_tilt_1",
glazing_system,
Tarcog::ISO15099::System::Uvalue,
update_results);
// change tilt, make sure results change
glazing_system->set_tilt(10);

test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/tilt/deflection_on_tilt_2",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/tilt",
"deflection_on_tilt_2",
glazing_system,
Tarcog::ISO15099::System::Uvalue,
update_results);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class Test_2_layers_nfrc_102_air_nfrc_102_deflection_youngs_modulus : public tes

TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_youngs_modulus, Test_Deflection_Off)
{
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/youngs_modulus/deflection_off",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/youngs_modulus",
"deflection_off",
glazing_system_u,
Tarcog::ISO15099::System::Uvalue,
update_results);
Expand All @@ -68,26 +68,26 @@ TEST_F(Test_2_layers_nfrc_102_air_nfrc_102_deflection_youngs_modulus, Test_Defle
{
glazing_system_u->enable_deflection(true);

test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/youngs_modulus/deflection_on_winter_u_run",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/youngs_modulus",
"deflection_on_winter_u_run",
glazing_system_u,
Tarcog::ISO15099::System::Uvalue,
update_results);
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/youngs_modulus/deflection_on_winter_shgc_run",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/youngs_modulus",
"deflection_on_winter_shgc_run",
glazing_system_u,
Tarcog::ISO15099::System::SHGC,
update_results);

glazing_system_shgc->enable_deflection(true);

test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/youngs_modulus/deflection_on_summer_u_run",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/youngs_modulus",
"deflection_on_summer_u_run",
glazing_system_shgc,
Tarcog::ISO15099::System::Uvalue,
update_results);
test_deflection_results("2_layers/nfrc_102_air_nfrc_102",
"deflection/youngs_modulus/deflection_on_summer_shgc_run",
test_deflection_results("2_layers/nfrc_102_air_nfrc_102/deflection/youngs_modulus",
"deflection_on_summer_shgc_run",
glazing_system_shgc,
Tarcog::ISO15099::System::SHGC,
update_results);
Expand Down
Loading

0 comments on commit 9e49690

Please sign in to comment.