RASCSI/cpp/test/localizer_test.cpp
Daniel Markstedt 08194af424
Move C++ code into cpp/ dir (#941)
- Moved C++ code to cpp/ from src/raspberrypi
- Related updates to Makefile, easyinstall.sh, and the github build rules
- Removed the native X68k C code in src/x68k from the repo
2022-10-25 12:59:30 -07:00

34 lines
1010 B
C++

//---------------------------------------------------------------------------
//
// SCSI Target Emulator RaSCSI Reloaded
// for Raspberry Pi
//
// Copyright (C) 2022 Uwe Seimet
//
//---------------------------------------------------------------------------
#include <gtest/gtest.h>
#include "rascsi/localizer.h"
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"));
}