xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
tests
libxrpl
basics
tests/libxrpl/basics/contract.cpp
1
#include <xrpl/basics/contract.h>
2
3
#include <gtest/gtest.h>
4
5
#include <
stdexcept
>
6
7
using namespace
xrpl
;
8
9
TEST(
Contract
, contract)
10
{
11
try
12
{
13
Throw<std::runtime_error>
(
"Throw test"
);
14
}
15
catch
(
std::runtime_error
const
& e1)
16
{
17
EXPECT_STREQ(e1.
what
(),
"Throw test"
);
18
19
try
20
{
21
rethrow
();
22
}
23
catch
(
std::runtime_error
const
& e2)
24
{
25
EXPECT_STREQ(e2.
what
(),
"Throw test"
);
26
}
27
catch
(...)
28
{
29
FAIL() <<
"std::runtime_error should have been re-caught"
;
30
}
31
}
32
catch
(...)
33
{
34
FAIL() <<
"std::runtime_error should have been caught the first time"
;
35
}
36
}
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::rethrow
XRPL_NO_SANITIZE_ADDRESS void rethrow()
Rethrow the exception currently being handled.
Definition
contract.h:36
xrpl::LedgerNameSpace::Contract
@ Contract
Definition
Indexes.cpp:110
xrpl::Throw
XRPL_NO_SANITIZE_ADDRESS void Throw(Args &&... args)
Definition
contract.h:52
std::runtime_error
stdexcept
std::runtime_error::what
T what(T... args)
Generated by
1.17.0