Skip to content

Commit

Permalink
Try the new optional in the test.
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-robertson committed Jun 4, 2024
1 parent 718493e commit 5017a02
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/utilities/filetypes/test/EpwFile_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ TEST(Filetypes, EpwFile_LeapTimeSeries) {
boost::optional<TimeSeries> _t;
ASSERT_NO_THROW(_t = epwFile.getTimeSeries("Dry Bulb Temperature"));
ASSERT_TRUE(_t);
// isActal is true, so it should be a timeSeries with the actual year
// isActual is true, so it should be a timeSeries with the actual year
boost::optional<int> _timeSeriesBaseYear = _t->firstReportDateTime().date().baseYear();
ASSERT_TRUE(_timeSeriesBaseYear);
EXPECT_EQ(2012, _timeSeriesBaseYear.get());
Expand All @@ -530,8 +530,12 @@ TEST(Filetypes, EpwFile_LeapTimeSeries_NoLeapDay) {
path p = resourcesPath() / toPath("utilities/Filetypes/leapyear-noleapday-test.epw");
EpwFile epwFile(p);
boost::optional<TimeSeries> _t;
ASSERT_NO_THROW(_t = epwFile.getTimeSeries("Dry Bulb Temperature"));
ASSERT_NO_THROW(_t = epwFile.getTimeSeries("Dry Bulb Temperature", true));
ASSERT_TRUE(_t);
// isActual is true, so it should be a timeSeries with the actual year
boost::optional<int> _timeSeriesBaseYear = _t->firstReportDateTime().date().baseYear();
ASSERT_TRUE(_timeSeriesBaseYear);
EXPECT_EQ(2012, _timeSeriesBaseYear.get());
} catch (...) {
ASSERT_TRUE(false);
}
Expand Down

0 comments on commit 5017a02

Please sign in to comment.