NorMIT-nav  22.09
An IGT application
cxtestProbeFixture.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 
13 #include "cxtestProbeFixture.h"
14 
15 #include <QString>
16 
18 #include "cxProbeDefinition.h"
19 #include "cxTestVideoSource.h"
20 #include "cxReporter.h"
21 #include "catch.hpp"
22 
23 namespace cxtest
24 {
25 
27  mDefaultTemporalCalibration(0),
28  mTemporalCalibration(0)
29 {
30  // this stuff will be performed just before all tests in this class
32  this->createTestProbe();
33 }
34 
35 
37 {
38  // this stuff will be performed just after all tests in this class
40 }
41 
42 
44 {
45  this->createParameters();
46  QString xmlFileName = "testXmlFileName";
48  mXml.reset(new ProbeXmlConfigParserMock(xmlFileName));
49  mDefaultRtSourceName = mXml->getRtSourceList(mProbeName, mScannerName)[0];
51 }
52 
53 
55 {
56  QString xmlFileName = "testXmlFileName";
58  bool provideRTSource = false;
59  mXml.reset(new ProbeXmlConfigParserMock(xmlFileName, provideRTSource));
60  mDefaultRtSourceName = QString();
62 }
63 
65 {
66  mProbeName = "TestProbe";
67  mScannerName = "TestScanner";
68  cx::ProbeDefinition probeDefinition;
69  mDefaultProbeDefinitionUid = probeDefinition.getUid(); //Uid set to "default" in ProbeDefinition()
71  mProbeDefinitionUid = "TestprobeDefinition";
72 }
73 
75 {
76  cx::ProbeDefinition probeDefinition = mProbe->getProbeDefinition();
77  probeDefinition.setUid(mProbeDefinitionUid);
78  mTemporalCalibration = 1000.5;
80  return probeDefinition;
81 }
82 
83 } //namespace cxtest
cx::ProbeDefinition
Definition of characteristics for an Ultrasound Probe Sector.
Definition: cxProbeDefinition.h:101
ProbeXmlConfigParserPtr
boost::shared_ptr< ProbeXmlConfigParser > ProbeXmlConfigParserPtr
Definition: ProbeXmlConfigParser.h:100
cxtest::ProbeFixture::createTestProbe
void createTestProbe()
Definition: cxtestProbeFixture.cpp:43
cxProbeDefinition.h
cxtest::ProbeFixture::mDefaultProbeDefinitionUid
QString mDefaultProbeDefinitionUid
Definition: cxtestProbeFixture.h:43
cx::Reporter::shutdown
static void shutdown()
shutdown service, destroy static object if none holds a reference.
Definition: cxReporter.cpp:73
cx::ProbeImpl::New
static ProbeImplPtr New(QString instrumentUid, QString scannerUid, ProbeXmlConfigParserPtr xml=ProbeXmlConfigParserPtr())
Definition: cxProbeImpl.cpp:28
cxtest::ProbeFixture::ProbeFixture
ProbeFixture()
Definition: cxtestProbeFixture.cpp:26
cxtest::ProbeFixture::mDefaultTemporalCalibration
double mDefaultTemporalCalibration
Definition: cxtestProbeFixture.h:47
cxtest::ProbeFixture::createProbeDefinition
cx::ProbeDefinition createProbeDefinition()
Definition: cxtestProbeFixture.cpp:74
ProbeXmlConfigParserMock
Moc implementation of abstract interface ProbeXmlConfigParser All function return dummy values.
Definition: ProbeXmlConfigParserMock.h:31
cxtest::ProbeFixture::mProbe
cx::ProbeImplPtr mProbe
Definition: cxtestProbeFixture.h:46
cxReporter.h
cxtest::ProbeFixture::~ProbeFixture
~ProbeFixture()
Definition: cxtestProbeFixture.cpp:36
cxtest::ProbeFixture::mProbeName
QString mProbeName
Definition: cxtestProbeFixture.h:41
cxTestVideoSource.h
cx::ProbeDefinition::getUid
QString getUid() const
Definition: cxProbeDefinition.cpp:171
cxtest::ProbeFixture::mDefaultRtSourceName
QString mDefaultRtSourceName
Definition: cxtestProbeFixture.h:45
cxtest::ProbeFixture::createParameters
void createParameters()
Definition: cxtestProbeFixture.cpp:64
ProbeXmlConfigParserMock.h
cxtest
Definition: cxtestDirectSignalListener.cpp:13
cxtest::ProbeFixture::mTemporalCalibration
double mTemporalCalibration
Definition: cxtestProbeFixture.h:48
cxtestProbeFixture.h
cx::ProbeDefinition::setTemporalCalibration
void setTemporalCalibration(double value)
Definition: cxProbeDefinition.cpp:106
cx::ProbeDefinition::setUid
void setUid(QString uid)
Definition: cxProbeDefinition.cpp:176
cxtest::ProbeFixture::mScannerName
QString mScannerName
Definition: cxtestProbeFixture.h:42
cxtest::ProbeFixture::mProbeDefinitionUid
QString mProbeDefinitionUid
Definition: cxtestProbeFixture.h:44
cx::ProbeDefinition::getTemporalCalibration
double getTemporalCalibration() const
Definition: cxProbeDefinition.cpp:144
cxtest::ProbeFixture::testProbeWithNoRTSource
void testProbeWithNoRTSource()
Definition: cxtestProbeFixture.cpp:54
cx::Reporter::initialize
static void initialize()
Initialize logging, static object is guaranteed to exist at least until shutdown.
Definition: cxReporter.cpp:60