THM1176InstrumentManager 1.1
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"
11
12using namespace MTL::Instrument;
13using namespace MTL::Instrument::THM1176Types;
14
16class CTHM1176ConnectTest : public ::testing::Test
17{
18protected:
19 THM1176_TEST_RESOURCE_MANAGER_CLASS ResourceManager;
21 static const U32 THM1176_TIMEOUT = 5000; // ms
22
23 virtual void SetUp()
24 {
26 }
27};
28
30TEST_F(CTHM1176ConnectTest, ConnectDisconnect)
31{
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(CTHM1176ConnectTest, ConnectDisconnect)
unsigned int U32
32-bit unsigned integer.
Definition OSDefines.h:31
Utility functions used to test THM1176 API.
bool FetchTHM1176Resource(THM1176_TEST_RESOURCE_MANAGER_CLASS &rResourceManager, tResourceName &rTHM1176)
Open a connection to the Resource Manager and find a THM1176.
Type conversion routines for C++ API for Metrolab THM1176/TFM1186.
Test THM1176 API: Connect, Disconnect.
static const U32 THM1176_TIMEOUT
THM1176_TEST_RESOURCE_MANAGER_CLASS ResourceManager
THM1176 instrument class.
Definition THM1176.h:98
bool Connect(U32 InitialTimeout, bool Exclusive=true, std::string *pErrMsg=nullptr)
Open the connection to the instrument.
Definition THM1176.cpp:850
void Disconnect()
Close the connection to the instrument.
Definition THM1176.cpp:917
std::string tResourceName
IEEE488 resource name.