devilutionX/test/appfat_test.cpp
Gleb Mazovetskiy 7e230df94a Allow forcing Hellfire with command-line flags
This is useful for systems such as batocera.linux that have dynamic
launcher items that depend on the presence of the appropriate MPQ files.
2021-10-25 13:52:14 +01:00

26 lines
649 B
C++

#include <gtest/gtest.h>
#include "appfat.h"
#include "diablo.h"
using namespace devilution;
TEST(Appfat, app_fatal)
{
EXPECT_EXIT(app_fatal("test"), ::testing::ExitedWithCode(1), "test");
}
TEST(Appfat, ErrDlg)
{
EXPECT_EXIT(ErrDlg("Title", "Unknown error", "appfat.cpp", 7), ::testing::ExitedWithCode(1), "Unknown error\n\nThe error occurred at: appfat.cpp line 7");
}
TEST(Appfat, InsertCDDlg)
{
EXPECT_EXIT(InsertCDDlg("diabdat.mpq"), ::testing::ExitedWithCode(1), "diabdat.mpq");
}
TEST(Appfat, DirErrorDlg)
{
EXPECT_EXIT(DirErrorDlg("/"), ::testing::ExitedWithCode(1), "Unable to write to location:\n/");
}