-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #4606 separate mock objects that require gmock
which I don't have on LENS
- Loading branch information
Janik Zikovsky
committed
Jan 22, 2012
1 parent
da81456
commit 4ac9da2
Showing
5 changed files
with
58 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
Code/Mantid/Framework/TestHelpers/inc/MantidTestHelpers/FakeGmockObjects.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#ifndef FAKEGMOCKOBJECTS_H_ | ||
#define FAKEGMOCKOBJECTS_H_ | ||
|
||
/* | ||
* FakeObjects.h: Fake Tester objects for APITest | ||
* | ||
* Created on: Jul 5, 2011 | ||
* Author: Janik Zikovsky | ||
*/ | ||
|
||
#include "MantidAPI/ISpectrum.h" | ||
#include "MantidAPI/MatrixWorkspace.h" | ||
#include "MantidKernel/cow_ptr.h" | ||
#include "MantidAPI/NumericAxis.h" | ||
#include "MantidGeometry/Instrument.h" | ||
#include "MantidGeometry/ISpectraDetectorMap.h" | ||
#include "MantidGeometry/Instrument/DetectorGroup.h" | ||
#include "MantidGeometry/Instrument/INearestNeighbours.h" | ||
#include "gmock/gmock.h" | ||
#include <iostream> | ||
#include <fstream> | ||
#include <map> | ||
|
||
using namespace Mantid::API; | ||
using namespace Mantid::Kernel; | ||
using namespace Mantid; | ||
|
||
|
||
//Helper and typedef for mocking NearestNeighbourFactory usage | ||
class MockNearestNeighboursFactory : public Mantid::Geometry::INearestNeighboursFactory | ||
{ | ||
public: | ||
MOCK_METHOD3(create, Mantid::Geometry::INearestNeighbours*(boost::shared_ptr<const Mantid::Geometry::Instrument>,const Mantid::Geometry::ISpectraDetectorMap&, bool)); | ||
virtual ~MockNearestNeighboursFactory() | ||
{ | ||
} | ||
}; | ||
|
||
//Helper typedef and type for mocking NearestNeighbour map usage. | ||
typedef std::map<Mantid::specid_t, Mantid::Kernel::V3D> SpectrumDistanceMap; | ||
class MockNearestNeighbours : public Mantid::Geometry::INearestNeighbours { | ||
public: | ||
MOCK_CONST_METHOD2(neighbours, SpectrumDistanceMap(const specid_t spectrum, const double radius)); | ||
MOCK_CONST_METHOD3(neighbours, SpectrumDistanceMap(const specid_t spectrum, bool force, const int numberofneighbours)); | ||
MOCK_METHOD0(die, void()); | ||
virtual ~MockNearestNeighbours() | ||
{ | ||
die(); | ||
} | ||
}; | ||
|
||
|
||
|
||
|
||
#endif /* FAKEOBJECTS_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters