少年修仙传客户端基础资源
hch
2024-04-11 4c71d74b77c9eb62a0323698c9a0db3b641a917e
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
#if ENABLE_UNIT_TESTS
 
#include "UnitTest++.h"
 
#include "../Console-c-api.h"
#include "../../Console.h"
 
struct ConsoleFixture
{
    ConsoleFixture()
    {
        ms_timeout = 0;
    }
 
    ~ConsoleFixture()
    {
    }
 
    int32_t ms_timeout;
    int32_t *size;
    int32_t *classSize;
    uint8_t controlChars[17];
};
 
SUITE(Console)
{
// Console commands are only supported on POSIX platforms
#if IL2CPP_TARGET_POSIX
    TEST_FIXTURE(ConsoleFixture, InternalKeyAvailableReturnsValid)
    {
        CHECK_EQUAL(0, UnityPalConsoleInternalKeyAvailable(ms_timeout));
    }
 
    TEST_FIXTURE(ConsoleFixture, InternalKeyAvailableMatchesClass)
    {
        CHECK_EQUAL(il2cpp::os::Console::InternalKeyAvailable(ms_timeout), UnityPalConsoleInternalKeyAvailable(ms_timeout));
    }
 
    TEST_FIXTURE(ConsoleFixture, SetBreakReturnsValid)
    {
        CHECK_EQUAL(0, UnityPalConsoleSetBreak(true));
    }
 
    TEST_FIXTURE(ConsoleFixture, SetBreakMatchesClass)
    {
        CHECK_EQUAL((int32_t)il2cpp::os::Console::SetBreak(true), UnityPalConsoleSetBreak(true));
    }
 
    TEST_FIXTURE(ConsoleFixture, SetEchoReturnsValid)
    {
        CHECK_EQUAL(0, UnityPalConsoleSetEcho(true));
    }
 
    TEST_FIXTURE(ConsoleFixture, SetEchoMatchesClass)
    {
        CHECK_EQUAL((int32_t)il2cpp::os::Console::SetEcho(true), UnityPalConsoleSetBreak(true));
    }
 
    TEST_FIXTURE(ConsoleFixture, TtySetupMatchesClass)
    {
        il2cpp::os::Console::TtySetup("", "", controlChars, &classSize);
        UnityPalConsoleTtySetup("", "", controlChars, &size);
        CHECK_EQUAL(*classSize, *size);
    }
 
#endif
}
 
#endif // ENABLE_UNIT_TESTS