| THM1176InstrumentManager 1.2 Qt Object abstraction for Metrolab THM1176

Loading...
Searching...
No Matches
IEEE488InstrumentOpenCloseTest.h File Reference

Test IEEE488 Instrument: Open, Close, IsOpen methods. More...

`#include <gtest/gtest.h>`
`#include <regex>`
`#include <future>`
`#include "IEEE488InstrumentTest.h"`
`#include "Exception.h"`
`#include "Helpers.h"`
Include dependency graph for IEEE488InstrumentOpenCloseTest.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
class | IEEE488InstrumentOpenCloseLockTest

## Functions
static void | l_OpenLoopQueryClose (IEEE4888_TEST_RESOURCE_MANAGER_CLASS *pResourceManager, std::string InstrumentName, U32 NSeconds, std::promise< bool > &rSucceeded, std::promise< U32 > &rNLoopsPerformed)
| Utility function to be run in a separate thread: open an instrument, do an *IDN?, wait a while and then close.
static void | l_OpenLockWaitClose (IEEE4888_TEST_RESOURCE_MANAGER_CLASS *pResourceManager, std::string InstrumentName, U32 NSeconds, std::promise< bool > &rSucceeded)
| Utility function to be run in a separate thread: keep an instrument locked for a while.
| TEST_F (IEEE488InstrumentOpenCloseLockTest, OpenClose)
| Test Instrument object creation/destruction, Open, Close, Status, StatusDescription.
| TEST_F (IEEE488InstrumentOpenCloseLockTest, OpenCloseTwice)
| Test Instrument object creation/destruction, Open, Close, Status, StatusDescription.
| TEST_F (IEEE488InstrumentOpenCloseLockTest, ShareInstrument)
| Test two threads sharing an instrument.
| TEST_F (IEEE488InstrumentOpenCloseLockTest, LockWhenAlreadyLocked)
| TEST_F (IEEE488InstrumentOpenCloseLockTest, LockAfterWait)

## Variables
static const U32 | IEEE488_TEST_DURATION = 5

## Detailed Description

Test IEEE488 Instrument: Open, Close, IsOpen methods.

Definition in file IEEE488InstrumentOpenCloseTest.h.

## Function Documentation

## ◆ l_OpenLockWaitClose()

void l_OpenLockWaitClose | ( | IEEE4888_TEST_RESOURCE_MANAGER_CLASS * | pResourceManager,
|  | std::string | InstrumentName,
|  | U32 | NSeconds,
|  | std::promise< bool > & | rSucceeded )
| static

Utility function to be run in a separate thread: keep an instrument locked for a while.

Definition at line 118 of file IEEE488InstrumentOpenCloseTest.h.

## ◆ l_OpenLoopQueryClose()

void l_OpenLoopQueryClose | ( | IEEE4888_TEST_RESOURCE_MANAGER_CLASS * | pResourceManager,
|  | std::string | InstrumentName,
|  | U32 | NSeconds,
|  | std::promise< bool > & | rSucceeded,
|  | std::promise< U32 > & | rNLoopsPerformed )
| static

Utility function to be run in a separate thread: open an instrument, do an *IDN?, wait a while and then close.

Definition at line 44 of file IEEE488InstrumentOpenCloseTest.h.

## ◆ TEST_F() [1/5]

TEST_F | ( | IEEE488InstrumentOpenCloseLockTest | ,
|  | LockAfterWait | )

Test
  Ensure that LockExclusive() succeeds if the instrument is already locked in another thread, but we wait long enough.

Definition at line 354 of file IEEE488InstrumentOpenCloseTest.h.

## ◆ TEST_F() [2/5]

TEST_F | ( | IEEE488InstrumentOpenCloseLockTest | ,
|  | LockWhenAlreadyLocked | )

Test
  Ensure that LockExclusive() fails if the instrument is already locked in another thread.

Definition at line 318 of file IEEE488InstrumentOpenCloseTest.h.

## ◆ TEST_F() [3/5]

TEST_F | ( | IEEE488InstrumentOpenCloseLockTest | ,
|  | OpenClose | )

Test Instrument object creation/destruction, Open, Close, Status, StatusDescription.

Definition at line 160 of file IEEE488InstrumentOpenCloseTest.h.

## ◆ TEST_F() [4/5]

TEST_F | ( | IEEE488InstrumentOpenCloseLockTest | ,
|  | OpenCloseTwice | )

Test Instrument object creation/destruction, Open, Close, Status, StatusDescription.

Definition at line 195 of file IEEE488InstrumentOpenCloseTest.h.

## ◆ TEST_F() [5/5]

TEST_F | ( | IEEE488InstrumentOpenCloseLockTest | ,
|  | ShareInstrument | )

Test two threads sharing an instrument.

Definition at line 252 of file IEEE488InstrumentOpenCloseTest.h.

## Variable Documentation

## ◆ IEEE488_TEST_DURATION

const U32 IEEE488_TEST_DURATION = 5
| static

Definition at line 39 of file IEEE488InstrumentOpenCloseTest.h.