mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-29 16:49:55 +00:00
08194af424
- 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
55 lines
1.1 KiB
C++
55 lines
1.1 KiB
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator RaSCSI Reloaded
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2022 Uwe Seimet
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
#include "rascsi/command_context.h"
|
|
|
|
TEST(CommandContext, GetSerializer)
|
|
{
|
|
CommandContext context("", -1);
|
|
|
|
// There is nothing more that can be tested
|
|
context.GetSerializer();
|
|
}
|
|
|
|
TEST(CommandContext, IsValid)
|
|
{
|
|
CommandContext context("", -1);
|
|
|
|
EXPECT_FALSE(context.IsValid());
|
|
|
|
context.SetFd(1);
|
|
EXPECT_TRUE(context.IsValid());
|
|
}
|
|
|
|
TEST(CommandContext, Cleanup)
|
|
{
|
|
CommandContext context("", 0);
|
|
|
|
EXPECT_EQ(0, context.GetFd());
|
|
context.Cleanup();
|
|
EXPECT_EQ(-1, context.GetFd());
|
|
}
|
|
|
|
TEST(CommandContext, ReturnLocalizedError)
|
|
{
|
|
CommandContext context("en_US", -1);
|
|
|
|
EXPECT_FALSE(context.ReturnLocalizedError(LocalizationKey::ERROR_LOG_LEVEL));
|
|
}
|
|
|
|
TEST(CommandContext, ReturnStatus)
|
|
{
|
|
CommandContext context("", -1);
|
|
|
|
EXPECT_TRUE(context.ReturnStatus(true, "status"));
|
|
EXPECT_FALSE(context.ReturnStatus(false, "status"));
|
|
}
|