Files
itgmania212121/extern/IXWebSocket-11.3.2/test/IXSentryClientTest.cpp
T
Martin Natano dc49af3c59 Implement NetworkManager
For now there are two methods:

- `NETWORK:IsUrlAllowed()`: Check whether access to a certain URL is allowed.
- `NETWORK:HttpRequest()`: Perform an HTTP request.

By default access to the network is disabled for all target hosts. It
can be enabled by setting `HttpEnable=1` in the preferences. Individual
hosts have to be added to `HttpAllowHosts` as a comma separated list to
allow access.

See included docs for more details on usage.
2022-01-15 22:56:08 +01:00

43 lines
1.2 KiB
C++

/*
* IXSentryClientTest.cpp
* Author: Benjamin Sergeant
* Copyright (c) 2019 Machine Zone. All rights reserved.
*
* (cd .. ; make) && ../build/test/ixwebsocket_unittest sentry
*/
#include "catch.hpp"
#include <iostream>
#include <ixsentry/IXSentryClient.h>
#include <string.h>
using namespace ix;
namespace ix
{
TEST_CASE("sentry", "[sentry]")
{
SECTION("Attempt to index nil")
{
SentryClient sentryClient("");
std::string stack = "Attempt to index nil[overlay]!\nstack traceback:\n\tfoo.lua:2661: "
"in function 'getFoo'\n\tfoo.lua:1666: in function "
"'onUpdate'\n\tfoo.lua:1751: in function <foo.lua:1728>";
auto frames = sentryClient.parseLuaStackTrace(stack);
REQUIRE(frames.size() == 3);
}
SECTION("Attempt to perform nil")
{
SentryClient sentryClient("");
std::string stack = "Attempt to perform nil - 1572111278.299\nstack "
"traceback:\n\tfoo.lua:57: in function <foo.lua:53>";
auto frames = sentryClient.parseLuaStackTrace(stack);
REQUIRE(frames.size() == 1);
}
}
} // namespace ix