Skip to content

Commit

Permalink
Refs #5564 clang format changes applied
Browse files Browse the repository at this point in the history
  • Loading branch information
josephframsay committed Jul 14, 2017
1 parent 1eac766 commit cfe264a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 52 deletions.
32 changes: 16 additions & 16 deletions Framework/Algorithms/src/ConjoinWorkspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,22 @@ void ConjoinWorkspaces::exec() {
// Set the result workspace to the first input
setProperty("InputWorkspace1", output);
} else {
// Check that the input workspaces meet the requirements for this algorithm
this->validateInputs(*ws1, *ws2);

if (this->getProperty("CheckOverlapping")) {
this->checkForOverlap(*ws1, *ws2, true);
m_overlapChecked = true;
}

MatrixWorkspace_sptr output = execWS2D(*ws1, *ws2);
// Copy the history from the original workspace
output->history().addHistory(ws1->getHistory());

// Delete the second input workspace from the ADS
AnalysisDataService::Instance().remove(getPropertyValue("InputWorkspace2"));
// Set the result workspace to the first input
setProperty("InputWorkspace1", output);
// Check that the input workspaces meet the requirements for this algorithm
this->validateInputs(*ws1, *ws2);

if (this->getProperty("CheckOverlapping")) {
this->checkForOverlap(*ws1, *ws2, true);
m_overlapChecked = true;
}

MatrixWorkspace_sptr output = execWS2D(*ws1, *ws2);
// Copy the history from the original workspace
output->history().addHistory(ws1->getHistory());

// Delete the second input workspace from the ADS
AnalysisDataService::Instance().remove(getPropertyValue("InputWorkspace2"));
// Set the result workspace to the first input
setProperty("InputWorkspace1", output);
}
}

Expand Down
72 changes: 36 additions & 36 deletions Framework/Algorithms/test/ConjoinWorkspacesTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,17 @@ class ConjoinWorkspacesTest : public CxxTest::TestSuite {
}

void testMismatchedEventWorkspace() {
auto ws1 = setupMismatchedWorkspace(0, 2, "100,200,700");
auto ws2 = setupMismatchedWorkspace(3, 5, "100,200,1000");
auto ws1 = setupMismatchedWorkspace(0, 2, "100,200,700");
auto ws2 = setupMismatchedWorkspace(3, 5, "100,200,1000");

ConjoinWorkspaces conj;
conj.initialize();
conj.setRethrows(true);
ConjoinWorkspaces conj;
conj.initialize();
conj.setRethrows(true);

conj.setProperty("InputWorkspace1", ws1);
conj.setProperty("InputWorkspace2", ws2);
TS_ASSERT_THROWS(conj.execute(), std::invalid_argument);
TS_ASSERT(!conj.isExecuted());
conj.setProperty("InputWorkspace1", ws1);
conj.setProperty("InputWorkspace2", ws2);
TS_ASSERT_THROWS(conj.execute(), std::invalid_argument);
TS_ASSERT(!conj.isExecuted());
}

void testDoCheckForOverlap() {
Expand Down Expand Up @@ -260,35 +260,35 @@ class ConjoinWorkspacesTest : public CxxTest::TestSuite {
const std::string ws1Name;
const std::string ws2Name;

MatrixWorkspace_sptr setupMismatchedWorkspace(int startIndex, int endIndex, const std::string& rebinParams) const {
MatrixWorkspace_sptr ews =
WorkspaceCreationHelper::createEventWorkspace(10, 10);

// Crop ews to have first 3 spectra, ews2 to have second 3
CropWorkspace crop;
crop.setChild(true);
crop.initialize();
crop.setProperty("InputWorkspace", ews);
crop.setProperty("StartWorkspaceIndex", startIndex);
crop.setProperty("EndWorkspaceIndex", endIndex);
crop.setProperty("OutputWorkspace", "out");
crop.execute();

MatrixWorkspace_sptr cropped = crop.getProperty("OutputWorkspace");

Rebin rebin;
rebin.setChild(true);
rebin.initialize();
rebin.setProperty("InputWorkspace", cropped);
rebin.setProperty("Params", rebinParams);
rebin.setProperty("OutputWorkspace", "out");
rebin.execute();

MatrixWorkspace_sptr out = rebin.getProperty("OutputWorkspace");
return out;
MatrixWorkspace_sptr
setupMismatchedWorkspace(int startIndex, int endIndex,
const std::string &rebinParams) const {
MatrixWorkspace_sptr ews =
WorkspaceCreationHelper::createEventWorkspace(10, 10);

// Crop ews to have first 3 spectra, ews2 to have second 3
CropWorkspace crop;
crop.setChild(true);
crop.initialize();
crop.setProperty("InputWorkspace", ews);
crop.setProperty("StartWorkspaceIndex", startIndex);
crop.setProperty("EndWorkspaceIndex", endIndex);
crop.setProperty("OutputWorkspace", "out");
crop.execute();

MatrixWorkspace_sptr cropped = crop.getProperty("OutputWorkspace");

Rebin rebin;
rebin.setChild(true);
rebin.initialize();
rebin.setProperty("InputWorkspace", cropped);
rebin.setProperty("Params", rebinParams);
rebin.setProperty("OutputWorkspace", "out");
rebin.execute();

MatrixWorkspace_sptr out = rebin.getProperty("OutputWorkspace");
return out;
}

};

#endif /*CONJOINWORKSPACESTEST_H_*/

0 comments on commit cfe264a

Please sign in to comment.