2022-10-23 19:51:39 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2022-12-05 17:58:23 +00:00
|
|
|
// SCSI Target Emulator PiSCSI
|
2022-10-23 19:51:39 +00:00
|
|
|
// for Raspberry Pi
|
|
|
|
//
|
|
|
|
// Copyright (C) 2022 Uwe Seimet
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
2022-12-05 17:58:23 +00:00
|
|
|
#include "piscsi/localizer.h"
|
2022-10-23 19:51:39 +00:00
|
|
|
|
|
|
|
TEST(Localizer, Localize)
|
|
|
|
{
|
|
|
|
Localizer localizer;
|
|
|
|
|
|
|
|
string message = localizer.Localize(LocalizationKey::ERROR_AUTHENTICATION, "");
|
|
|
|
EXPECT_FALSE(message.empty());
|
|
|
|
EXPECT_EQ(string::npos, message.find("enum value"));
|
|
|
|
|
|
|
|
message = localizer.Localize(LocalizationKey::ERROR_AUTHENTICATION, "de_DE");
|
|
|
|
EXPECT_FALSE(message.empty());
|
|
|
|
EXPECT_EQ(string::npos, message.find("enum value"));
|
|
|
|
|
|
|
|
message = localizer.Localize(LocalizationKey::ERROR_AUTHENTICATION, "en");
|
|
|
|
EXPECT_FALSE(message.empty());
|
|
|
|
EXPECT_EQ(string::npos, message.find("enum value"));
|
|
|
|
|
|
|
|
message = localizer.Localize((LocalizationKey)1234, "");
|
|
|
|
EXPECT_FALSE(message.empty());
|
|
|
|
EXPECT_NE(string::npos, message.find("enum value"));
|
|
|
|
}
|