Horizon Official Technical Documentation
ZoneServerTest.cpp File Reference
#include "Server/Zone/Socket/ZoneSocket.hpp"
#include "Server/Zone/SocketMgr/ClientSocketMgr.hpp"
#include "Server/Zone/Session/ZoneSession.hpp"
#include "Server/Common/Server.hpp"
#include "Server/Common/System.hpp"
#include "Server/Zone/ZoneSystem.hpp"
#include "Server/Zone/Zone.hpp"
#include <boost/mysql/error_with_diagnostics.hpp>
#include <boost/mysql/handshake_params.hpp>
#include <boost/mysql/results.hpp>
#include <boost/mysql/static_results.hpp>
#include <boost/mysql/tcp_ssl.hpp>
#include <boost/describe/class.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/ssl/context.hpp>
#include <boost/system/system_error.hpp>
#include <boost/test/included/unit_test.hpp>
+ Include dependency graph for ZoneServerTest.cpp:

Macros

#define BOOST_TEST_MODULE   ZoneServerTest
 

Functions

 BOOST_AUTO_TEST_CASE (ZoneServerTest)
 

Macro Definition Documentation

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   ZoneServerTest

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( ZoneServerTest  )

Fixed : Exception thrown at 0x00007FFA63663FAA (ntdll.dll) in ZoneSystemTest.exe: 0xC0000005: Access violation writing location 0x0000000000000024. The program '[27192] ZoneSystemTest.exe' has exited with code 0 (0x0).

Note
The reason for this error was that the io_context belonged to Server class and not Kernel. Which resulted in the destruction of io_context before the DatabaseProcess was destroyed. Lingering _connection object caused issues without an io_context available.

Error 2 Detected-

Exception thrown at 0x00007FFA60FAF39C in ZoneSystemTest.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0000001B13EFE380. Exception thrown at 0x00007FFA60FAF39C in ZoneSystemTest.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000. Exception thrown at 0x00007FFA60FAF39C in ZoneSystemTest.exe: Microsoft C++ exception: boost::execution_exception at memory location 0x0000001B13EFBF50. Running 1 test case... unknown location(0): fatal error: in "SCENARIO_LOGIN_TEST": class std::bad_alloc: bad allocation C:\Users\Sagun Khosla\Desktop\Repos\horizon\src\Tests\ZoneSystemTest.cpp(55): last checkpoint: "SCENARIO_LOGIN_TEST" test entry

** 1 failure is detected in the test module "ZoneSystemTest"

Error 3 - Exception thrown at 0x00007FF606B15F8F in ZoneSystemTest.exe: 0xC0000005: Access violation reading location 0x00000000000000C3.

Error 5 - Exception thrown at 0x00007FF6C2CE601F in ZoneSystemTest.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

Error 4 -

Exception thrown at 0x00007FFA60FAF39C in ZoneSystemTest.exe: Microsoft C++ exception: std::length_error at memory location 0x000000F7240FE710. Exception thrown at 0x00007FFA60FAF39C in ZoneSystemTest.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000. Exception thrown at 0x00007FFA60FAF39C in ZoneSystemTest.exe: Microsoft C++ exception: boost::execution_exception at memory location 0x000000F7240FC2D0. unknown location(0): fatal error: in "SCENARIO_LOGIN_TEST": class std::length_error: string too long C:\Users\Sagun Khosla\Desktop\Repos\horizon\src\Tests\ZoneSystemTest.cpp(55): last checkpoint: "SCENARIO_LOGIN_TEST" test entry *** 1 failure is detected in the test module "ZoneSystemTest" The program '[26396] ZoneSystemTest.exe' has exited with code 201 (0xc9).

Error 6 - Exception thrown at 0x00007FF6000AD2A0 in ZoneSystemTest.exe: 0xC0000005: Access violation reading location 0x0000000100000029.

57{
65 try {
66 sZone->general_conf().set_test_run(TEST_RUN_MINIMAL);
67
68 sZone->general_conf().set_config_file_path("config/zone-server.lua.dist");
69 sZone->read_config();
70
71 sZone->config().set_static_db_path(std::string("db/"));
72 HLog(info) << "Static database path set to " << sZone->config().get_static_db_path() << "";
73
74 sZone->config().set_mapcache_path(std::string("db/maps.dat"));
75 HLog(info) << "Mapcache file name is set to " << sZone->config().get_mapcache_path() << ", it will be read while initializing maps.";
76
77 sZone->config().set_script_root_path(std::string("scripts/"));
78
80
81 sZone->initialize();
82 } catch(std::length_error &e) {
83 std::cerr << "Exception caught: " << e.what() << std::endl;
84 } catch(std::bad_alloc &e) {
85 std::cerr << "Exception caught: " << e.what() << std::endl;
86 } catch(std::exception &e) {
87 std::cerr << "Exception caught: " << e.what() << std::endl;
88 } catch(...) {
89 std::cerr << "Unknown exception caught." << std::endl;
90 }
91 // Following errors caused by command line issues on VSCode Debugger. It is captured and handled but hopefully there will be a complete fix for it.
92 // It is seemingly complicated to resolve, there are bad allocations spammed from command line input when running tests on VSCode Debugger.
93 // It may happen the same way for other debuggers, good to take note of it.
129}
#define HLog(type)
Definition: Logger.hpp:122
@ TEST_RUN_MINIMAL
Definition: ServerConfiguration.hpp:40
@ SHUTDOWN_INITIATED
Definition: Server.hpp:65
void set_shutdown_stage(shutdown_stages new_stage)
Definition: Server.hpp:75
#define sZone
Definition: Zone.hpp:247

References HLog, set_shutdown_stage(), SHUTDOWN_INITIATED, sZone, and TEST_RUN_MINIMAL.

+ Here is the call graph for this function: