| THM1176InstrumentManager 1.2 Qt Object abstraction for Metrolab THM1176

Loading...
Searching...
No Matches
CTHM1176ConnectTest.cpp
Go to the documentation of this file.
1// Copyright (c) 2020 Metrolab Technology S.A., Geneva, Switzerland (www.metrolab.com)
2// See the included file LICENSE.txt for the licensing conditions.
3
7
8#include "gtest/gtest.h"
9#include "THM1176TestUtilities.h"
10#include "THM1176TypeConversions.h"
11
12 using namespace MTL::Instrument;
13 using namespace MTL::Instrument::THM1176Types;
14
16 class CTHM1176ConnectTest : public ::testing::Test
17{
18 protected:
19 THM1176_TEST_RESOURCE_MANAGER_CLASS ResourceManager;
20 tResourceName THM1176;
21 static const U32 THM1176_TIMEOUT = 5000; // ms
22
23 virtual void SetUp()
24 {
25 ASSERT_EQ(true, FetchTHM1176Resource(ResourceManager, THM1176));
26 }
27};
28
30 TEST_F(CTHM1176ConnectTest, ConnectDisconnect)
31{
32 CTHM1176Instrument<THM1176_TEST_INSTRUMENT_CLASS, THM1176_TEST_RESOURCE_MANAGER_CLASS> l_THM1176(ResourceManager, THM1176);
33 ASSERT_EQ(true, l_THM1176.Connect(THM1176_TIMEOUT));
34 ASSERT_EQ(true, l_THM1176.IsOpen());
35 l_THM1176.Disconnect();
36 ASSERT_EQ(false, l_THM1176.IsOpen());
37}
38
TEST_F
TEST_F(CTHM1176ConnectTest, ConnectDisconnect)
Definition CTHM1176ConnectTest.cpp:30
U32
unsigned int U32
32-bit unsigned integer.
Definition OSDefines.h:31
THM1176TestUtilities.h
Utility functions used to test THM1176 API.
FetchTHM1176Resource
bool FetchTHM1176Resource(THM1176_TEST_RESOURCE_MANAGER_CLASS &rResourceManager, tResourceName &rTHM1176)
Open a connection to the Resource Manager and find a THM1176.
Definition THM1176TestUtilities.cpp:15
THM1176TypeConversions.h
Type conversion routines for C++ API for Metrolab THM1176/TFM1186.
CTHM1176ConnectTest
Test THM1176 API: Connect, Disconnect.
Definition CTHM1176ConnectTest.cpp:17
CTHM1176ConnectTest::THM1176_TIMEOUT
static const U32 THM1176_TIMEOUT
Definition CTHM1176ConnectTest.cpp:21
CTHM1176ConnectTest::THM1176
tResourceName THM1176
Definition CTHM1176ConnectTest.cpp:20
CTHM1176ConnectTest::ResourceManager
THM1176_TEST_RESOURCE_MANAGER_CLASS ResourceManager
Definition CTHM1176ConnectTest.cpp:19
CTHM1176ConnectTest::SetUp
virtual void SetUp()
Definition CTHM1176ConnectTest.cpp:23
MTL::Instrument::CTHM1176Instrument
THM1176 instrument class.
Definition THM1176.h:98
MTL::Instrument::CTHM1176Instrument::Connect
bool Connect(U32 InitialTimeout, bool Exclusive=true, std::string *pErrMsg=nullptr)
Open the connection to the instrument.
Definition THM1176.cpp:866
MTL::Instrument::CTHM1176Instrument::Disconnect
void Disconnect()
Close the connection to the instrument.
Definition THM1176.cpp:933
MTL::Instrument::THM1176Types
Definition THM1176TypeConversions.h:20
MTL::Instrument
Definition THM1176.h:74
MTL::Instrument::tResourceName
std::string tResourceName
IEEE488 resource name.
Definition IEEE488InstrumentTypes.h:22