Skip to content

Commit 6196d59

Browse files
committed
Merge branch 'develop' into cppcheck_continued
2 parents cb75cae + 9dc2343 commit 6196d59

File tree

3 files changed

+59
-29
lines changed

3 files changed

+59
-29
lines changed

.github/workflows/test_pull_requests.yml

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,22 @@ jobs:
2323
macos_dev_target: 14.0
2424
arch: arm64
2525
python-arch: arm64
26-
enable_pch: ON
2726
run_regressions: true
2827
pretty: "Mac arm64"
2928
- os: ubuntu-24.04
3029
arch: x86_64
3130
python-arch: x64
32-
enable_pch: ON
3331
run_regressions: true
3432
pretty: "Ubuntu 24.04"
3533
- os: windows-2022
3634
arch: x86_64
3735
python-arch: x64
38-
enable_pch: OFF
3936
run_regressions: false
4037
pretty: "Windows x64"
4138

4239
steps:
4340

44-
- name: Checkout PR head
45-
uses: actions/checkout@v6
46-
with:
47-
repository: ${{ github.event.pull_request.head.repo.full_name }}
48-
ref: ${{ github.event.pull_request.head.sha }}
49-
fetch-depth: 0
41+
- uses: actions/checkout@v6
5042

5143
- name: Setup System
5244
id: setup-runner
@@ -58,26 +50,21 @@ jobs:
5850
- name: Get Develop and Branch Git SHA
5951
shell: bash
6052
run: |
61-
echo "Figuring out the develop GIT SHA already merged into the PR branch"
62-
BASE_BRANCH="${{ github.base_ref }}"
63-
if git remote get-url upstream >/dev/null 2>&1; then
64-
git remote set-url upstream "https://github.com/$GITHUB_REPOSITORY.git"
65-
else
66-
git remote add upstream "https://github.com/$GITHUB_REPOSITORY.git"
67-
fi
68-
git fetch --no-tags upstream "refs/heads/${BASE_BRANCH}:refs/remotes/upstream/${BASE_BRANCH}"
69-
DEVELOP_SHA=$(git merge-base HEAD "upstream/${BASE_BRANCH}")
70-
echo "Develop GIT SHA merged into this branch is '${DEVELOP_SHA}'"
53+
echo "Figuring out the develop GIT SHA"
54+
# github.event.pull_request.base.sha points to develop at the time the PR was created, not the current one
55+
DEVELOP_SHA=$(git ls-remote https://github.com/$GITHUB_REPOSITORY.git develop | cut -f1 | cut -c1-10)
56+
echo "Develop GIT SHA is '${DEVELOP_SHA}'"
7157
echo "DEVELOP_SHA=$DEVELOP_SHA" >> $GITHUB_ENV
7258
7359
CURRENT_HEAD_SHA=${{ github.event.pull_request.head.sha }}
7460
echo "Current Branch HEAD SHA is '${CURRENT_HEAD_SHA}'"
75-
echo "CURRENT_HEAD_SHA=$CURRENT_HEAD_SHA" >> $GITHUB_ENV
61+
echo "CURRENT_HEAD_SHA=$DEVELOP_SHA" >> $GITHUB_ENV
7662
77-
echo "GitHub synthetic merge commit SHA is '${GITHUB_SHA}'"
63+
echo "Current merge commit SHA is '${GITHUB_SHA}'"
7864
echo "::endgroup::"
79-
# Default PCH behavior is per-platform, then regression-cache hits may override it.
80-
echo "ENABLE_PCH=${{ matrix.enable_pch }}" >> $GITHUB_ENV
65+
# We default to using PCH, in case we don't find the baseline reg tests,
66+
# since it speeds up the build significantly and we'll build TWICE
67+
echo "ENABLE_PCH=ON" >> $GITHUB_ENV
8168
8269
- name: Baseline Regression Testing caching
8370
uses: actions/cache@v5
@@ -105,6 +92,8 @@ jobs:
10592
restore-keys: |
10693
ccache-${{ matrix.os }}-${{ steps.setup-runner.outputs.compiler-id }}-${{ github.head_ref }}
10794
ccache-${{ matrix.os }}-${{ steps.setup-runner.outputs.compiler-id }}-${{ env.DEVELOP_SHA }}
95+
ccache-${{ matrix.os }}-${{ steps.setup-runner.outputs.compiler-id }}-
96+
ccache-${{ matrix.os }}-
10897
10998
- name: Did restoring the CCache-cache work?
11099
shell: bash
@@ -151,8 +140,7 @@ jobs:
151140
if: matrix.run_regressions && steps.cachebaselineregression.outputs.cache-hit != 'true'
152141
uses: actions/checkout@v6
153142
with:
154-
repository: ${{ github.repository }}
155-
ref: ${{ env.DEVELOP_SHA }}
143+
ref: develop
156144
clean: false # Do NOT wipe the build/ and .ccache folder (`git clean -ffdx && git reset --hard HEAD`)
157145

158146
- name: Baseline Configure and Build
@@ -196,8 +184,6 @@ jobs:
196184
if: matrix.run_regressions && steps.cachebaselineregression.outputs.cache-hit != 'true'
197185
uses: actions/checkout@v6
198186
with:
199-
repository: ${{ github.event.pull_request.head.repo.full_name }}
200-
ref: ${{ env.CURRENT_HEAD_SHA }}
201187
clean: false # Do NOT wipe the build/ and .ccache folder (`git clean -ffdx && git reset --hard HEAD`)
202188

203189
- name: Install problem matcher

src/EnergyPlus/WindowManager.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,7 @@ namespace Window {
16731673
std::fill(constr.AbsBeamShadeCoef.begin(), constr.AbsBeamShadeCoef.end(), 0.0);
16741674
std::fill(constr.TransSolBeamCoef.begin(), constr.TransSolBeamCoef.end(), 0.0);
16751675
std::fill(constr.ReflSolBeamFrontCoef.begin(), constr.ReflSolBeamFrontCoef.end(), 0.0);
1676-
std::fill(constr.ReflSolBeamBackCoef.begin(), constr.ReflSolBeamBackCoef.begin(), 0.0);
1676+
std::fill(constr.ReflSolBeamBackCoef.begin(), constr.ReflSolBeamBackCoef.end(), 0.0);
16771677
std::fill(constr.TransVisBeamCoef.begin(), constr.TransVisBeamCoef.end(), 0.0);
16781678
constr.AbsDiff = 0.0;
16791679
constr.AbsDiffBack = 0.0;

tst/EnergyPlus/unit/WindowManager.unit.cc

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
#include <EnergyPlus/CurveManager.hh>
6363
#include <EnergyPlus/DataEnvironment.hh>
6464
#include <EnergyPlus/DataGlobals.hh>
65-
#include <EnergyPlus/DataHeatBalFanSys.hh>
6665
#include <EnergyPlus/DataHeatBalSurface.hh>
6766
#include <EnergyPlus/DataHeatBalance.hh>
6867
#include <EnergyPlus/DataIPShortCuts.hh>
@@ -89,6 +88,51 @@
8988
using namespace EnergyPlus;
9089
using namespace EnergyPlus::Window;
9190

91+
TEST_F(EnergyPlusFixture, W5InitGlassParameters_ClearsCoefficients)
92+
{
93+
state->dataHeatBal->MaxSolidWinLayers = 1;
94+
state->dataHeatBal->TotConstructs = 1;
95+
state->dataConstruction->Construct.allocate(state->dataHeatBal->TotConstructs);
96+
97+
auto &construct = state->dataConstruction->Construct(1);
98+
construct.setArraysBasedOnMaxSolidWinLayers(*state);
99+
construct.TypeIsWindow = true;
100+
construct.TotLayers = 1;
101+
construct.TotSolidLayers = 1;
102+
construct.TotGlassLayers = 1;
103+
construct.LayerPoint.allocate(1);
104+
construct.LayerPoint(1) = 1;
105+
construct.AbsBeamShadeCoef = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
106+
construct.TransSolBeamCoef = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
107+
construct.ReflSolBeamFrontCoef = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
108+
construct.ReflSolBeamBackCoef = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
109+
construct.TransVisBeamCoef = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
110+
111+
state->dataSurface->TotSurfaces = 0;
112+
113+
W5InitGlassParameters(*state);
114+
115+
for (auto const &coeff : construct.AbsBeamShadeCoef) {
116+
EXPECT_EQ(0.0, coeff);
117+
}
118+
119+
for (auto const &coeff : construct.TransSolBeamCoef) {
120+
EXPECT_EQ(0.0, coeff);
121+
}
122+
123+
for (auto const &coeff : construct.ReflSolBeamFrontCoef) {
124+
EXPECT_EQ(0.0, coeff);
125+
}
126+
127+
for (auto const &coeff : construct.ReflSolBeamBackCoef) {
128+
EXPECT_EQ(0.0, coeff);
129+
}
130+
131+
for (auto const &coeff : construct.TransVisBeamCoef) {
132+
EXPECT_EQ(0.0, coeff);
133+
}
134+
}
135+
92136
TEST_F(EnergyPlusFixture, WindowFrameTest)
93137
{
94138

0 commit comments

Comments
 (0)