Commit 9222c28b authored by Danny Hindson's avatar Danny Hindson
Browse files

Fix problem on Jenkins cppcheck job

Fix grep command that counts cppcheck errors
In order to trigger the job on Jenkins for this PR I have also
modified a couple of C++ files - specifically I have resolved a
cppcheck warning on method parameter in one of my algorithms
(CalculateMultipleScattering)
parent 0f52c824
......@@ -77,7 +77,7 @@ private:
Kernel::V3D sourcePos, Kernel::PseudoRandomNumberGenerator &rng);
Geometry::Track generateInitialTrack(const Geometry::IObject &shape,
std::shared_ptr<const Geometry::ReferenceFrame> frame,
const Kernel::V3D sourcePos, Kernel::PseudoRandomNumberGenerator &rng);
const Kernel::V3D &sourcePos, Kernel::PseudoRandomNumberGenerator &rng);
void inc_xyz(Geometry::Track &track, double vl);
void updateWeightAndPosition(Geometry::Track &track, double &weight, const double vmfp, const double sigma_total,
Kernel::PseudoRandomNumberGenerator &rng);
......
......@@ -686,7 +686,7 @@ void CalculateMultipleScattering::updateWeightAndPosition(Geometry::Track &track
*/
Geometry::Track CalculateMultipleScattering::generateInitialTrack(const Geometry::IObject &shape,
std::shared_ptr<const Geometry::ReferenceFrame> frame,
const V3D sourcePos,
const V3D &sourcePos,
Kernel::PseudoRandomNumberGenerator &rng) {
auto sampleBox = shape.getBoundingBox();
// generate random point on front surface of sample bounding box
......
......@@ -4,7 +4,7 @@ SCRIPT_DIR=$(dirname "$0")
# If errors slip through to master this can be used to set a non-zero
# allowed count while those errors are dealt with. This avoids breaking all
# builds for all developers
ALLOWED_ERRORS_COUNT=288
ALLOWED_ERRORS_COUNT=287
if [[ ${JOB_NAME} == *pull_requests* ]]; then
# This relies on the fact pull requests use pull/$PR-NAME
......@@ -41,7 +41,7 @@ cmake --build . --target cppcheck
cppcheck-htmlreport --file=cppcheck.xml --title=Embedded --report-dir=cppcheck-report
# Mark build as passed or failed
errors_count=$(grep -c '</error>' $1)
errors_count=$(grep -c '</error>' cppcheck.xml)
if [ $errors_count -gt ${ALLOWED_ERRORS_COUNT} ]; then
echo "CppCheck found ${ALLOWED_ERRORS_COUNT} errors."
echo "See CppCheck link on the job page for more detail."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment