devilutionX/test/dead_test.cpp
ephphatha b12de6fe12 Use scoped enum for Direction
Identified and removed an instance of Direction being used as an argument for a bool parameter

Removed a single-use temporary variable being cast from sprite frame to direction to size_t

Co-authored-by: Anders Jenbo <anders@jenbo.dk>

Fix alignment of WalkSettings array
2021-09-12 02:27:47 +02:00

19 lines
448 B
C++

#include <gtest/gtest.h>
#include "dead.h"
#include "engine.h"
#include "gendung.h"
using namespace devilution;
TEST(Corpses, AddCorpse)
{
AddCorpse({ 21, 48 }, 8, Direction::West);
EXPECT_EQ(dCorpse[21][48], 8 + (static_cast<int>(Direction::West) << 5));
}
TEST(Corpses, AddCorpse_OOB)
{
AddCorpse({ 21, 48 }, MaxCorpses + 1, Direction::West);
EXPECT_EQ(dCorpse[21][48], 0 + (static_cast<int>(Direction::West) << 5));
}