Skip to content

Commit

Permalink
Merge branch 'fix/bc-save-develop' of https://github.com/AntaresSimul…
Browse files Browse the repository at this point in the history
…atorTeam/Antares_Simulator into fix/bc-save-develop
  • Loading branch information
payetvin committed Feb 19, 2025
2 parents 1e03fc7 + 8e00baa commit f835580
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,38 @@ jobs:
batch-name: adequacy-patch-CSR
os: ${{ matrix.os }}

- name: Run tests introduced in 8.6.0
continue-on-error: true
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-v860
os: ${{ env.os }}

- name: Run tests introduced in 8.7.0
continue-on-error: true
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-v870
os: ${{ env.os }}

- name: Run tests introduced in 9.1.0
continue-on-error: true
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-v910
os: ${{ env.os }}

- name: Run tests introduced in 9.2.0
continue-on-error: true
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-v920
os: ${{ env.os }}

- name: Collect coverage into one XML report
run: |
gcovr --sonarqube --output coverage.xml
Expand Down
2 changes: 1 addition & 1 deletion simtest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "v9.2.0i"
"version": "v9.2.0k"
}
6 changes: 5 additions & 1 deletion src/solver/variable/surveyresults/surveyresults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,11 @@ SurveyResults::SurveyResults(const Data::Study& s, const Yuni::String& o, IResul
digestNonApplicableStatus = new bool*[digestSize];
for (uint i = 0; i < digestSize; i++)
{
digestNonApplicableStatus[i] = new bool[maxVariables]{false};
digestNonApplicableStatus[i] = new bool[maxVariables];
for (uint var = 0; var != maxVariables; ++var)
{
digestNonApplicableStatus[i][var] = false;
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/tests/src/solver/variable/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ include(${CMAKE_SOURCE_DIR}/tests/macros.cmake)
add_boost_test(test-intermediate
SRC test_intermediate.cpp
LIBS antares-solver-variable)

add_boost_test(test-surveyresults
SRC test_surveyresults.cpp
LIBS
antares-solver-variable
result_writer)
56 changes: 56 additions & 0 deletions src/tests/src/solver/variable/test_surveyresults.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright 2007-2024, RTE (https://www.rte-france.com)
* See AUTHORS.txt
* SPDX-License-Identifier: MPL-2.0
* This file is part of Antares-Simulator,
* Adequacy and Performance assessment for interconnected energy networks.
*
* Antares_Simulator is free software: you can redistribute it and/or modify
* it under the terms of the Mozilla Public Licence 2.0 as published by
* the Mozilla Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Antares_Simulator is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Mozilla Public Licence 2.0 for more details.
*
* You should have received a copy of the Mozilla Public Licence 2.0
* along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
*/
#define BOOST_TEST_MODULE "test time series"

#define WIN32_LEAN_AND_MEAN

#include <boost/test/unit_test.hpp>

#include "antares/solver/variable/surveyresults.h"
#include "antares/writer/in_memory_writer.h"

using namespace Antares::Solver::Variable;

struct StudyFixture
{
StudyFixture():
study(std::make_unique<Antares::Data::Study>())
{
study->parameters.simulationDays.first = 0;
study->parameters.simulationDays.end = 7;
study->initializeRuntimeInfos();
}

std::unique_ptr<Antares::Data::Study> study;
};

BOOST_AUTO_TEST_SUITE(surveyresults)

BOOST_FIXTURE_TEST_CASE(no_variable_constructor_does_not_throw, StudyFixture)
{
Benchmarking::DurationCollector durationCollector;
Antares::Solver::InMemoryWriter writer(durationCollector);
// At least one area was required to trigger a std::bad_alloc throw
Antares::Data::addAreaToListOfAreas(study->areas, "dummyArea");
BOOST_CHECK_NO_THROW(SurveyResults survey(*study, "out", writer););
}

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit f835580

Please sign in to comment.