Skip to content
Snippets Groups Projects
Commit 318c465e authored by Matthew Andrew's avatar Matthew Andrew
Browse files

Removed unneeded code

parent c5bb553f
No related branches found
No related tags found
No related merge requests found
......@@ -898,6 +898,7 @@ set(TEST_FILES
test/FindFilesWorkerTest.h
test/FunctionModelTest.h
test/FunctionMultiDomainPresenterTest.h
test/FunctionBrowserUtilsTest.h
test/LogValueFinderTest.h
test/InterfaceManagerTest.h
test/NonOrthogonalTest.h
......
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
......
......@@ -284,7 +284,7 @@ void FunctionBrowser::updateMultiDatasetParameters(
}
} else {
auto const i = getCurrentDataset();
setLocalParameterValue(name, static_cast<int>(i),
setLocalParameterValue(name, i,
valueColumn->toDouble(0),
errorColumn->toDouble(0));
}
......
......@@ -76,10 +76,8 @@ splitConstraintString(const QString &constraint) {
if (expr.size() == 3) { // lower < param < upper
try {
// check that the first and third terms are numbers
double d1 = boost::lexical_cast<double>(expr[0].str());
(void)d1;
double d2 = boost::lexical_cast<double>(expr[2].str());
(void)d2;
boost::lexical_cast<double>(expr[0].str());
boost::lexical_cast<double>(expr[2].str());
if (expr[1].operator_name() == "<" && expr[2].operator_name() == "<") {
lowerBoundStr = QString::fromStdString(expr[0].str());
upperBoundStr = QString::fromStdString(expr[2].str());
......@@ -95,8 +93,7 @@ splitConstraintString(const QString &constraint) {
size_t paramPos = 0;
try // find position of the parameter name in expression
{
double d = boost::lexical_cast<double>(expr[1].name());
(void)d;
boost::lexical_cast<double>(expr[1].name());
} catch (...) {
paramPos = 1;
}
......
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
// Copyright &copy; 2019 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
......
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright &copy; 2019 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTIDWIDGETS_FUNCTIONBROWSERUTILSTEST_H_
#define MANTIDWIDGETS_FUNCTIONBROWSERUTILSTEST_H_
#include "MantidAPI/FrameworkManager.h"
#include "MantidQtWidgets/Common/FunctionBrowser/FunctionBrowserUtils.h"
#include <cxxtest/TestSuite.h>
class FunctionBrowserUtilsTest : public CxxTest::TestSuite {
public:
void test_splitConstraintString_returns_empty_if_given_empty_string() {
QString testConstraint = "";
auto splitConstraints = MantidQt::MantidWidgets::splitConstraintString(testConstraint);
std::pair<QString, std::pair<QString, QString>> error;
TS_ASSERT_EQUALS(splitConstraints, error);
}
void test_splitConstraintString_double_constraint() {
QString testConstraint = "0.1<A<0.2";
auto splitConstraints = MantidQt::MantidWidgets::splitConstraintString(testConstraint);
auto expected_value = std::make_pair(QString("A"), std::make_pair(QString("0.1"), QString("0.2")));
TS_ASSERT_EQUALS(splitConstraints, expected_value);
}
void test_splitConstraintString_lower_bound() {
QString testConstraint = "0.1<A";
auto splitConstraints = MantidQt::MantidWidgets::splitConstraintString(testConstraint);
auto expected_value = std::make_pair(QString("A"), std::make_pair(QString("0.1"), QString("")));
TS_ASSERT_EQUALS(splitConstraints, expected_value);
}
void test_splitConstraintString_upper_bound() {
QString testConstraint = "A<0.2";
auto splitConstraints = MantidQt::MantidWidgets::splitConstraintString(testConstraint);
auto expected_value = std::make_pair(QString("A"), std::make_pair(QString(""), QString("0.2")));
TS_ASSERT_EQUALS(splitConstraints, expected_value);
}
void test_splitConstraintString_invalid_double_constraint() {
QString testConstraint = "a<A<0.2";
auto splitConstraints = MantidQt::MantidWidgets::splitConstraintString(testConstraint);
auto expected_value = std::make_pair(QString(""), std::make_pair(QString(""), QString("")));
TS_ASSERT_EQUALS(splitConstraints, expected_value);
}
};
#endif // MANTIDWIDGETS_FUNCTIONBROWSERUTILSTEST_H_
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment