Fixed unit tests and version formatting (#1062)

This commit is contained in:
Uwe Seimet 2023-01-07 09:50:37 +01:00 committed by GitHub
parent 1af48e6e71
commit ae4b9a70ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -3,7 +3,7 @@
// SCSI Target Emulator PiSCSI
// for Raspberry Pi
//
// Copyright (C) 2021-2022 Uwe Seimet
// Copyright (C) 2021-2023 Uwe Seimet
//
//---------------------------------------------------------------------------
@ -74,7 +74,7 @@ string piscsi_util::Banner(const string& app)
s << "Version " << piscsi_get_version_string() << " (" << __DATE__ << ' ' << __TIME__ << ")\n";
s << "Powered by XM6 TypeG Technology / ";
s << "Copyright (C) 2016-2020 GIMONS\n";
s << "Copyright (C) 2020-2022 Contributors to the PiSCSI project\n";
s << "Copyright (C) 2020-2023 Contributors to the PiSCSI project\n";
return s.str();
}

View File

@ -23,13 +23,13 @@ string piscsi_get_version_string()
{
stringstream s;
s << setw(2) << setfill('0') << piscsi_major_version << '.' << piscsi_minor_version;
s << setw(2) << setfill('0') << piscsi_major_version << '.' << setw(2) << piscsi_minor_version;
if (piscsi_patch_version < 0) {
s << " --DEVELOPMENT BUILD--";
}
else {
s << '.' << piscsi_patch_version;
s << '.' << setw(2) << piscsi_patch_version;
}
return s.str();

View File

@ -3,7 +3,7 @@
// SCSI Target Emulator PiSCSI
// for Raspberry Pi
//
// Copyright (C) 2022 Uwe Seimet
// Copyright (C) 2022-2023 Uwe Seimet
//
//---------------------------------------------------------------------------
@ -106,7 +106,7 @@ TEST(HostServicesTest, ModeSense6)
// Minor version 0
EXPECT_EQ(0x00, buffer[7]);
// Year
EXPECT_NE(0x00, buffer[9]);
EXPECT_NE(0x00, buffer[8]);
// Day
EXPECT_NE(0x00, buffer[10]);
@ -151,7 +151,7 @@ TEST(HostServicesTest, ModeSense10)
// Minor version 0
EXPECT_EQ(0x00, buffer[11]);
// Year
EXPECT_NE(0x00, buffer[13]);
EXPECT_NE(0x00, buffer[12]);
// Day
EXPECT_NE(0x00, buffer[14]);

View File

@ -3,7 +3,7 @@
// SCSI Target Emulator PiSCSI
// for Raspberry Pi
//
// Copyright (C) 2022 Uwe Seimet
// Copyright (C) 2022-2023 Uwe Seimet
//
//---------------------------------------------------------------------------
@ -64,7 +64,7 @@ void TestInquiry(PbDeviceType type, device_type t, scsi_level l, const string& i
string product_data;
if (ident.size() == 24) {
ostringstream s;
s << ident << setw(2) << setfill('0') << piscsi_major_version << piscsi_minor_version;
s << ident << setw(2) << setfill('0') << piscsi_major_version << setw(2) << piscsi_minor_version;
product_data = s.str();
} else {
product_data = ident;