Browse Source

Test SetCursor_()

pull/578/head
Anders Jenbo 6 years ago
parent
commit
03067f0702
  1. 3
      CMakeLists.txt
  2. 2
      README.md
  3. 14
      SourceT/cursor.cpp

3
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})

2
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
---:| ---

14
SourceT/cursor.cpp

@ -0,0 +1,14 @@
#include <gtest/gtest.h>
#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);
}
Loading…
Cancel
Save