From 03067f070211d8f22b3f47103e89d6ab348bf5ef Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Fri, 7 Feb 2020 09:02:48 +0100 Subject: [PATCH] Test SetCursor_() --- CMakeLists.txt | 3 ++- README.md | 2 +- SourceT/cursor.cpp | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 SourceT/cursor.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 337458dcf..390cd4440 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -309,8 +309,9 @@ endif() if(RUN_TESTS) list(APPEND devilutionx_SRCS + SourceT/automap.cpp SourceT/control.cpp - SourceT/automap.cpp) + SourceT/cursor.cpp) endif() add_executable(${BIN_TARGET} WIN32 MACOSX_BUNDLE ${devilutionx_SRCS}) diff --git a/README.md b/README.md index da50b6878..c44e44719 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Downloads](https://img.shields.io/github/downloads/diasurgical/devilutionX/total.svg)](https://github.com/diasurgical/devilutionX/releases) [![github stars](https://img.shields.io/github/stars/diasurgical/devilutionX.svg)](https://github.com/diasurgical/devilutionX/stargazers) -[![Coverage Status](https://coveralls.io/repos/github/diasurgical/devilutionX/badge.svg?branch=HEAD)](https://coveralls.io/github/diasurgical/devilutionX?branch=HEAD) +[![codecov](https://codecov.io/gh/diasurgical/devilutionX/branch/master/graph/badge.svg)](https://codecov.io/gh/diasurgical/devilutionX) Nightly builds | Platform ---:| --- diff --git a/SourceT/cursor.cpp b/SourceT/cursor.cpp new file mode 100644 index 000000000..c04ee6328 --- /dev/null +++ b/SourceT/cursor.cpp @@ -0,0 +1,14 @@ +#include +#include "devilution.h" + +TEST(Cursor, SetCursor) { + int i = dvl::ICURS_SPIKED_CLUB + dvl::CURSOR_FIRSTITEM; + dvl::SetCursor_(i); + ASSERT_EQ(dvl::pcurs, i); + ASSERT_EQ(dvl::cursW, 1 * 28); + ASSERT_EQ(dvl::cursH, 3 * 28); + ASSERT_EQ(dvl::icursW, 1 * 28); + ASSERT_EQ(dvl::icursH, 3 * 28); + ASSERT_EQ(dvl::icursW28, 1); + ASSERT_EQ(dvl::icursH28, 3); +}