Commit 67b871f8 authored by Samuel Jones's avatar Samuel Jones
Browse files

Clang-formatting fixes

parent 9849ec6f
......@@ -77,7 +77,7 @@ public:
ax1.setValue(i, static_cast<double>(i + 1));
}
TS_ASSERT_THROWS(ax1.indexOfValue(0.9), const std::out_of_range &); // start
TS_ASSERT_THROWS(ax1.indexOfValue(0.9), const std::out_of_range &); // start
TS_ASSERT_THROWS(ax1.indexOfValue(10.1), const std::out_of_range &); // end
}
};
......
......@@ -528,12 +528,18 @@ public:
mfun->fix(10);
// g2->fix(1); // This doesn't work
TS_ASSERT_THROWS(mfun->setActiveParameter(0, 0), const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(1, 0), const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(4, 0), const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(6, 0), const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(7, 0), const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(10, 0), const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(0, 0),
const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(1, 0),
const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(4, 0),
const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(6, 0),
const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(7, 0),
const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(10, 0),
const std::runtime_error &);
mfun->setActiveParameter(2, 100);
mfun->setActiveParameter(3, 101);
......
......@@ -402,7 +402,8 @@ public:
void testEndOnOperator() {
{
Expression expression;
TS_ASSERT_THROWS(expression.parse("x+y+z + "), const std::runtime_error &);
TS_ASSERT_THROWS(expression.parse("x+y+z + "),
const std::runtime_error &);
}
{
Expression expression;
......
......@@ -22,7 +22,8 @@ public:
void test_Default_Object_Throws_When_Computing_Pulse_Variance() {
using namespace Mantid::API;
FermiChopperModel chopper;
TS_ASSERT_THROWS(chopper.pulseTimeVariance(), const std::invalid_argument &);
TS_ASSERT_THROWS(chopper.pulseTimeVariance(),
const std::invalid_argument &);
}
void test_Getters_Produce_Expected_Values_When_Set_By_Settings() {
......@@ -67,7 +68,8 @@ public:
chopper->setAngularVelocityInHz(350);
chopper->setChopperRadius(155.0 / 1000.);
TS_ASSERT_THROWS(chopper->pulseTimeVariance(), const std::invalid_argument &);
TS_ASSERT_THROWS(chopper->pulseTimeVariance(),
const std::invalid_argument &);
}
void
......
......@@ -23,8 +23,8 @@
using namespace Mantid::API;
using namespace Mantid::Kernel;
using ::testing::_;
using ::testing::Mock;
using ::testing::_;
class FunctionParameterDecoratorTest;
......
......@@ -59,7 +59,8 @@ public:
IFunction_sptr fun(new ConcreteFunction1DSpectrum);
TS_ASSERT_THROWS(fun->function(domain, values), const std::invalid_argument &);
TS_ASSERT_THROWS(fun->function(domain, values),
const std::invalid_argument &);
}
private:
......
......@@ -70,7 +70,8 @@ public:
EXPECT_CALL(wrongDomain, size()).WillRepeatedly(Return(1));
FunctionValues values(wrongDomain);
TS_ASSERT_THROWS(fn.function(wrongDomain, values), const std::invalid_argument &);
TS_ASSERT_THROWS(fn.function(wrongDomain, values),
const std::invalid_argument &);
MockJacobian jacobian;
TS_ASSERT_THROWS(fn.functionDeriv(wrongDomain, jacobian),
......
......@@ -42,13 +42,15 @@ public:
void test_Initializing_With_Invalid_String_Throws() {
Mantid::API::IkedaCarpenterModerator ikmod;
TS_ASSERT_THROWS(ikmod.initialize("TiltAngle"), const std::invalid_argument &);
TS_ASSERT_THROWS(ikmod.initialize("TiltAngle"),
const std::invalid_argument &);
}
void test_Initializing_With_String_Containing_Unknown_Parameter_Throws() {
Mantid::API::IkedaCarpenterModerator ikmod;
TS_ASSERT_THROWS(ikmod.initialize("unknown=6.3"), const std::invalid_argument &);
TS_ASSERT_THROWS(ikmod.initialize("unknown=6.3"),
const std::invalid_argument &);
}
void
......@@ -123,7 +125,8 @@ public:
TS_ASSERT_THROWS(ikmod->sampleTimeDistribution(1.01),
const std::invalid_argument &);
TS_ASSERT_THROWS(ikmod->sampleTimeDistribution(5.5), const std::invalid_argument &);
TS_ASSERT_THROWS(ikmod->sampleTimeDistribution(5.5),
const std::invalid_argument &);
}
private:
......
......@@ -29,7 +29,8 @@ public:
}
void testContructorFailsWithInvalidIndexType() {
TS_ASSERT_THROWS(IndexTypeProperty("IndexType", 0), const std::invalid_argument &);
TS_ASSERT_THROWS(IndexTypeProperty("IndexType", 0),
const std::invalid_argument &);
}
void testSingleIndexTypeAutomaticallySet() {
......
......@@ -13,8 +13,8 @@
#include "MantidKernel/Exception.h"
using Mantid::API::LatticeDomain;
using Mantid::Kernel::V3D;
using Mantid::Kernel::Exception::IndexError;
using Mantid::Kernel::V3D;
using namespace Mantid::API;
......
......@@ -43,7 +43,8 @@ public:
void test_logExistsButIsNotNumericTimeSeries_throws() {
auto ws = createTestWorkspace();
LogFilterGenerator generator(LogFilterGenerator::FilterType::Status, ws);
TS_ASSERT_THROWS(generator.generateFilter("BadLog"), const std::invalid_argument &);
TS_ASSERT_THROWS(generator.generateFilter("BadLog"),
const std::invalid_argument &);
}
void test_typeIsNone_noFilterReturned() {
......
......@@ -233,10 +233,12 @@ public:
FunctionValues values(domain);
multi.setDomainIndex(0, 3);
TS_ASSERT_THROWS(multi.function(domain, values), const std::invalid_argument &);
TS_ASSERT_THROWS(multi.function(domain, values),
const std::invalid_argument &);
multi.setDomainIndex(0, 4);
TS_ASSERT_THROWS(multi.function(domain, values), const std::invalid_argument &);
TS_ASSERT_THROWS(multi.function(domain, values),
const std::invalid_argument &);
}
void test_calc() {
......
......@@ -51,7 +51,8 @@ public:
using namespace Mantid::API;
FakeParamFunctionAttributeHolder funct;
TS_ASSERT_THROWS(funct.getAttribute("NonExistent"), const std::invalid_argument &);
TS_ASSERT_THROWS(funct.getAttribute("NonExistent"),
const std::invalid_argument &);
TS_ASSERT_THROWS(funct.setAttribute("NonExistent", IFunction::Attribute(1)),
const std::invalid_argument &);
}
......
......@@ -20,8 +20,10 @@ public:
static void destroySuite(ProgressTest *suite) { delete suite; }
void testBadParameters() {
TS_ASSERT_THROWS(Progress(nullptr, -1., 100., 42), const std::invalid_argument &);
TS_ASSERT_THROWS(Progress(nullptr, 1., .1, 42), const std::invalid_argument &);
TS_ASSERT_THROWS(Progress(nullptr, -1., 100., 42),
const std::invalid_argument &);
TS_ASSERT_THROWS(Progress(nullptr, 1., .1, 42),
const std::invalid_argument &);
}
};
......
......@@ -28,7 +28,8 @@ public:
void test_workspace_constructor() {
MatrixWorkspace_const_sptr ws;
TS_ASSERT_THROWS(SpectrumDetectorMapping map(ws), const std::invalid_argument &);
TS_ASSERT_THROWS(SpectrumDetectorMapping map(ws),
const std::invalid_argument &);
}
void test_workspace_constructor_fills_map() {
......@@ -155,9 +156,12 @@ public:
SpectrumDetectorMapping map(ws);
// The happy path is tested in the methods above. Just test invalid entry
// here.
TS_ASSERT_THROWS(map.getDetectorIDsForSpectrumNo(1), const std::out_of_range &);
TS_ASSERT_THROWS(map.getDetectorIDsForSpectrumNo(0), const std::out_of_range &);
TS_ASSERT_THROWS(map.getDetectorIDsForSpectrumNo(-1), const std::out_of_range &);
TS_ASSERT_THROWS(map.getDetectorIDsForSpectrumNo(1),
const std::out_of_range &);
TS_ASSERT_THROWS(map.getDetectorIDsForSpectrumNo(0),
const std::out_of_range &);
TS_ASSERT_THROWS(map.getDetectorIDsForSpectrumNo(-1),
const std::out_of_range &);
}
};
......
......@@ -96,7 +96,8 @@ public:
ConcreteVectorDblParamParser parser;
TSM_ASSERT_THROWS("No successor, so should throw!",
parser.createParameter(pRootElem), const std::runtime_error &);
parser.createParameter(pRootElem),
const std::runtime_error &);
}
DECLARE_VECTOR_PARAMETER(SucessorVectorParameter, double)
......
......@@ -55,14 +55,16 @@ public:
Mantid::Algorithms::AddNote alg;
TS_ASSERT_THROWS_NOTHING(alg.initialize());
TS_ASSERT_THROWS(alg.setPropertyValue("Name", ""), const std::invalid_argument &);
TS_ASSERT_THROWS(alg.setPropertyValue("Name", ""),
const std::invalid_argument &);
}
void test_empty_value_not_allowed() {
Mantid::Algorithms::AddNote alg;
TS_ASSERT_THROWS_NOTHING(alg.initialize());
TS_ASSERT_THROWS(alg.setPropertyValue("Value", ""), const std::invalid_argument &);
TS_ASSERT_THROWS(alg.setPropertyValue("Value", ""),
const std::invalid_argument &);
}
void test_empty_time_is_allowed() {
......
......@@ -81,21 +81,24 @@ public:
Mantid::Algorithms::AddTimeSeriesLog alg;
TS_ASSERT_THROWS_NOTHING(alg.initialize());
TS_ASSERT_THROWS(alg.setPropertyValue("Name", ""), const std::invalid_argument &);
TS_ASSERT_THROWS(alg.setPropertyValue("Name", ""),
const std::invalid_argument &);
}
void test_empty_time_not_allowed() {
Mantid::Algorithms::AddTimeSeriesLog alg;
TS_ASSERT_THROWS_NOTHING(alg.initialize());
TS_ASSERT_THROWS(alg.setPropertyValue("Time", ""), const std::invalid_argument &);
TS_ASSERT_THROWS(alg.setPropertyValue("Time", ""),
const std::invalid_argument &);
}
void test_empty_value_not_allowed() {
Mantid::Algorithms::AddTimeSeriesLog alg;
TS_ASSERT_THROWS_NOTHING(alg.initialize());
TS_ASSERT_THROWS(alg.setPropertyValue("Value", ""), const std::invalid_argument &);
TS_ASSERT_THROWS(alg.setPropertyValue("Value", ""),
const std::invalid_argument &);
}
void test_time_as_non_iso_formatted_string_throws_invalid_argument() {
......
......@@ -79,7 +79,8 @@ public:
void test_empty_log_name_throws_invalid_argument() {
Mantid::Algorithms::DeleteLog alg;
alg.initialize();
TS_ASSERT_THROWS(alg.setProperty("Name", ""), const std::invalid_argument &);
TS_ASSERT_THROWS(alg.setProperty("Name", ""),
const std::invalid_argument &);
}
};
......
......@@ -46,7 +46,8 @@ public:
"InputWorkspace", WorkspaceCreationHelper::createEventWorkspace()));
// LogName must not be empty
TS_ASSERT_THROWS(alg.setProperty("LogName", ""), const std::invalid_argument &);
TS_ASSERT_THROWS(alg.setProperty("LogName", ""),
const std::invalid_argument &);
// TimeTolerance cannot be negative
TS_ASSERT_THROWS(alg.setProperty("TimeTolerance", -0.1),
......@@ -55,7 +56,8 @@ public:
TS_ASSERT_THROWS_NOTHING(alg.setProperty("TimeTolerance", 0.0));
// LogBoundary must be one of "Centre" and "Left"
TS_ASSERT_THROWS(alg.setProperty("LogBoundary", ""), const std::invalid_argument &);
TS_ASSERT_THROWS(alg.setProperty("LogBoundary", ""),
const std::invalid_argument &);
TS_ASSERT_THROWS(alg.setProperty("LogBoundary", "Middle"),
const std::invalid_argument &);
TS_ASSERT_THROWS_NOTHING(alg.setProperty("LogBoundary", "Left"));
......
Supports Markdown
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