]> git.localhorst.tv Git - blank.git/blob - tst/integration/ClientTest.cpp
test some more parameters
[blank.git] / tst / integration / ClientTest.cpp
1 #include "ClientTest.hpp"
2
3 #include "TestInstance.hpp"
4
5 #include <thread>
6
7 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(blank::test::ClientTest, "headed");
8
9
10 namespace blank {
11 namespace test {
12
13 void ClientTest::setUp() {
14         server.reset(new TestInstance({ "--server", "--port", "12354", "--world-name", "brave-new-world" }, true));
15         server->AssertRunning();
16         server->AssertOutputLine("loading spawn chunks");
17         server->AssertOutputLine("listening on UDP port 12354");
18         client.reset(new TestInstance({ "--client", "--no-vsync", "--host", "localhost", "--port", "12354", "--player-name", "aldous" }));
19         client->AssertRunning();
20         client->AssertOutputLine("got message before interface was created: player \"aldous\" joined");
21         client->AssertOutputLine("joined game \"brave-new-world\"");
22         server->AssertOutputLine("player \"aldous\" joined");
23         server->AssertOutputLine("accepted login from player \"aldous\"");
24 }
25
26 void ClientTest::tearDown() {
27         std::unique_ptr<TestInstance> srv(std::move(server));
28         std::unique_ptr<TestInstance> cln(std::move(client));
29         if (cln) {
30                 cln->Terminate();
31                 cln->AssertNoOutput();
32                 cln->AssertNoError();
33                 cln->AssertExitStatus(0);
34         }
35         if (srv) {
36                 srv->Terminate();
37                 srv->AssertOutputLine("player \"aldous\" left");
38                 srv->AssertOutputLine("saving remaining chunks");
39                 srv->AssertNoOutput();
40                 srv->AssertNoError();
41                 srv->AssertExitStatus(0);
42         }
43 }
44
45
46 void ClientTest::testStartup() {
47
48 }
49
50 }
51 }