From 6748dc2aed08474e142f059359299240f99eb5e3 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Sun, 13 Dec 2020 10:52:43 -0500 Subject: [PATCH] Try to fix static code analysis issues. --- src/mlpack/tests/cf_test.cpp | 2 +- src/mlpack/tests/rnn_reber_test.cpp | 2 -- src/mlpack/tests/serialization_test.cpp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mlpack/tests/cf_test.cpp b/src/mlpack/tests/cf_test.cpp index 22b513b531..af5623f708 100644 --- a/src/mlpack/tests/cf_test.cpp +++ b/src/mlpack/tests/cf_test.cpp @@ -346,7 +346,7 @@ void TrainWithCoordinateList(DecompositionPolicy& decomposition) { arma::mat randomData(3, 100); randomData.row(0) = arma::linspace(0, 99, 100); - randomData.row(1) = arma::linspace(0, 99, 100); + randomData.row(1) = randomData.row(0); randomData.row(2).fill(3); CFType c(randomData, decomposition, 5, 5, 30); diff --git a/src/mlpack/tests/rnn_reber_test.cpp b/src/mlpack/tests/rnn_reber_test.cpp index 6471e3809f..da5d245592 100644 --- a/src/mlpack/tests/rnn_reber_test.cpp +++ b/src/mlpack/tests/rnn_reber_test.cpp @@ -179,7 +179,6 @@ void GenerateNextRecursiveReber(const arma::Mat& transitions, else if (c == 'P' && state == 1) { numPs++; - state = 1; } else if (c == 'T' && state == 1) { @@ -206,7 +205,6 @@ void GenerateNextRecursiveReber(const arma::Mat& transitions, else if (c == 'P' && state == 5) { numPs--; - state = 5; } } diff --git a/src/mlpack/tests/serialization_test.cpp b/src/mlpack/tests/serialization_test.cpp index c564f0a482..8ca83af9f8 100644 --- a/src/mlpack/tests/serialization_test.cpp +++ b/src/mlpack/tests/serialization_test.cpp @@ -1682,7 +1682,7 @@ TEST_CASE("CerealEmptyArrayWrapperTest", "[SerializationTest]") jsonT.mem = new int[5]; jsonT.len = 5; - SerializeObjectAll(t, xmlT, binaryT, jsonT); + SerializeObjectAll(t, xmlT, jsonT, binaryT); // Ensure that all the results are correct. REQUIRE(xmlT.mem == (int*) NULL);