File: test_player.cc

package info (click to toggle)
crawl 2%3A0.34.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 100,188 kB
  • sloc: cpp: 363,709; ansic: 27,765; javascript: 9,516; python: 8,463; perl: 3,293; java: 3,132; xml: 2,380; makefile: 1,835; sh: 611; objc: 250; cs: 15; sed: 9; lisp: 3
file content (103 lines) | stat: -rw-r--r-- 2,652 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#include "catch_amalgamated.hpp"

#include "AppHdr.h"
#include "mutation.h"
#include "player.h"

#include "test_player_fixture.h"

// Some of these a characterization tests which should be justifiably
// removed if the behaviour ever changes. Left in for now because it
// should be easy to tell the difference between a intentional change of
// the behaviour being tested and accidentally changing said behaviour.
//
TEST_CASE_METHOD(MockPlayerYouTestsFixture,
          "Test MockPlayerYouTestsFixture", "[single-file]" ) {

    REQUIRE(you.is_player());
}

TEST_CASE_METHOD(MockPlayerYouTestsFixture, "Can mutate player",
        "[single-file]" ) {
    mutate(MUT_ICY_BLUE_SCALES, "testing");
}

TEST_CASE_METHOD(MockPlayerYouTestsFixture,
          "Check single AC mutation", "[single-file]" ) {
    mutate(MUT_ICY_BLUE_SCALES, "testing");

    REQUIRE(you.base_ac(100) == 200);
}

TEST_CASE_METHOD(MockPlayerYouTestsFixture,
          "Check multiple AC mutation", "[single-file]" ) {

    mutate(MUT_ICY_BLUE_SCALES, "testing");

    mutate(MUT_GELATINOUS_BODY, "testing");

    REQUIRE(you.base_ac(100) == 300);
}

TEST_CASE_METHOD(MockPlayerYouTestsFixture,
          "Check each mutation once", "[single-file]" ) {

    mutate(MUT_ICY_BLUE_SCALES, "testing");

    REQUIRE(you.base_ac(100) == 200);
}

TEST_CASE_METHOD(MockPlayerYouTestsFixture,
          "Check gelatinous_body", "[single-file]" ) {
    mutate(MUT_GELATINOUS_BODY, "testing");

    REQUIRE(you.base_ac(100) == 100);
}

TEST_CASE_METHOD(MockPlayerYouTestsFixture,
          "Check iridescent scales", "[single-file]" ) {

    mutate(MUT_IRIDESCENT_SCALES, "testing");

    REQUIRE(you.base_ac(100) == 200);
}

TEST_CASE_METHOD(MockPlayerYouTestsFixture,
          "Check no potion heal ac (expect: no change)", "[single-file]" ) {

    mutate(MUT_NO_POTION_HEAL, "testing");

    REQUIRE(you.base_ac(100) == 0);
}

TEST_CASE_METHOD(MockPlayerYouTestsFixture,
          "Check rugged brown scales ac", "[single-file]" ) {

    mutate(MUT_RUGGED_BROWN_SCALES, "testing");

    REQUIRE(you.base_ac(100) == 100);
}

TEST_CASE_METHOD(MockPlayerYouTestsFixture,
          "Check molten scales ac", "[single-file]" ) {

    mutate(MUT_MOLTEN_SCALES, "testing");

    REQUIRE(you.base_ac(100) == 200);
}

TEST_CASE_METHOD(MockPlayerYouTestsFixture,
          "Check physical vuln", "[single-file]" ) {

    mutate(MUT_PHYSICAL_VULNERABILITY, "testing");

    REQUIRE(you.base_ac(100) == -500);

    mutate(MUT_PHYSICAL_VULNERABILITY, "testing");

    REQUIRE(you.base_ac(100) == -1000);

    mutate(MUT_PHYSICAL_VULNERABILITY, "testing");

    REQUIRE(you.base_ac(100) == -1500);
}