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
#include "gate/tests.hpp"
#include "gate/system/terminals.hpp"
#include "gate/wrappers.hpp"

using namespace gate;
using namespace gate::sys;

static void runTerminalTests(Terminal& term)
{
    Terminal::ColorEnum bgcol = Terminal::Color_Black;<--- Variable 'bgcol' is reassigned a value before the old one has been used.
    Terminal::ColorEnum txtcol = Terminal::Color_White;<--- Variable 'txtcol' is reassigned a value before the old one has been used.
    //uint16_t x = 0, y = 0;
    GATEXX_TEST_CHECK_NOTHROW(bgcol = term.getBackColor());<--- Variable 'bgcol' is reassigned a value before the old one has been used.
    GATEXX_TEST_CHECK_NOTHROW(txtcol = term.getTextColor());<--- Variable 'txtcol' is reassigned a value before the old one has been used.
    //GATEXX_TEST_CHECK_NOTHROW(term.getCursorPos(x, y));
    //GATEXX_TEST_CHECK_NOTHROW(term.setCursorPos(x, y));
    GATEXX_TEST_CHECK_NOTHROW(term.setBackColor(bgcol));
    GATEXX_TEST_CHECK_NOTHROW(term.setTextColor(txtcol));
    GATEXX_TEST_CHECK_NOTHROW(term.println("Hello current console terminal!"));
}

GATEXX_TEST_UNIT(TerminalConsole)
{
    Terminal term = Terminal::getConsole();
    runTerminalTests(term);
}

GATEXX_TEST_UNIT(TerminalNewConsole)
{
    Terminal term = Terminal::openConsole();
    runTerminalTests(term);
}