Skip to content
Snippets Groups Projects
Commit 0c53c116 authored by Steven Murray's avatar Steven Murray
Browse files

Fixed problematic gmock based global variable by replacing it with several copies.

This a port of Eric's original fix in CASTOR with git commit:

    aa83f8bdaae793eac7d261e7b5c6cba16acac248
parent f816cbcd
No related branches found
No related tags found
No related merge requests found
......@@ -32,12 +32,12 @@ using ::testing::Return;
using ::testing::_;
namespace unitTests {
castor::tape::System::mockWrapper sysWrapper;
TEST(castor_tape_SCSI_DeviceList, TriesToFind) {
/* Give minimal service output from mock system calls:
* at least pretend there is a directory to scan */
/* _ means anything goes */
castor::tape::System::mockWrapper sysWrapper;
EXPECT_CALL(sysWrapper, opendir(_)).Times(1);
EXPECT_CALL(sysWrapper, readdir(sysWrapper.m_DIR)).Times(1);
EXPECT_CALL(sysWrapper, closedir(sysWrapper.m_DIR)).Times(1);
......@@ -46,6 +46,7 @@ TEST(castor_tape_SCSI_DeviceList, TriesToFind) {
}
TEST(castor_tape_SCSI_DeviceList, ScansCorrectly) {
castor::tape::System::mockWrapper sysWrapper;
/* Configure the mock to use fake */
sysWrapper.delegateToFake();
/* Populate the test harness */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment