mirror of
https://github.com/akuker/RASCSI.git
synced 2026-04-21 18:17:07 +00:00
Improve code sharing and dependencies, address code duplication (#976)
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include "mocks.h"
|
||||
#include "rascsi_interface.pb.h"
|
||||
#include "protobuf_util.h"
|
||||
#include "shared/protobuf_util.h"
|
||||
#include "generated/rascsi_interface.pb.h"
|
||||
|
||||
using namespace rascsi_interface;
|
||||
using namespace protobuf_util;
|
||||
@@ -81,3 +81,28 @@ TEST(ProtobufUtil, SetPatternParams)
|
||||
EXPECT_EQ("folder", GetParam(command4, "folder_pattern"));
|
||||
EXPECT_EQ("file", GetParam(command4, "file_pattern"));
|
||||
}
|
||||
|
||||
TEST(ProtobufUtil, ListDevices)
|
||||
{
|
||||
list<PbDevice> devices;
|
||||
|
||||
EXPECT_FALSE(ListDevices(devices).empty());
|
||||
|
||||
PbDevice device;
|
||||
device.set_type(SCHD);
|
||||
devices.push_back(device);
|
||||
device.set_type(SCBR);
|
||||
devices.push_back(device);
|
||||
device.set_type(SCDP);
|
||||
devices.push_back(device);
|
||||
device.set_type(SCHS);
|
||||
devices.push_back(device);
|
||||
device.set_type(SCLP);
|
||||
devices.push_back(device);
|
||||
const string device_list = ListDevices(devices);
|
||||
EXPECT_FALSE(device_list.empty());
|
||||
EXPECT_NE(string::npos, device_list.find("X68000 HOST BRIDGE"));
|
||||
EXPECT_NE(string::npos, device_list.find("DaynaPort SCSI/Link"));
|
||||
EXPECT_NE(string::npos, device_list.find("Host Services"));
|
||||
EXPECT_NE(string::npos, device_list.find("SCSI Printer"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user