1#include <xrpl/basics/TaggedCache.h>
2#include <xrpl/basics/TaggedCache.ipp>
3#include <xrpl/basics/chrono.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/protocol/Protocol.h>
7#include <gtest/gtest.h>
8#include <helpers/TestSink.h>
21 using namespace std::chrono_literals;
34 EXPECT_EQ(c.size(), 0);
35 EXPECT_TRUE(c.insert(
"one"));
36 EXPECT_FALSE(c.insert(
"one"));
37 EXPECT_EQ(c.size(), 1);
38 EXPECT_TRUE(c.touchIfExists(
"one"));
41 EXPECT_EQ(c.size(), 1);
44 EXPECT_EQ(c.size(), 0);
45 EXPECT_FALSE(c.touchIfExists(
"one"));
52 EXPECT_TRUE(c.insert(
"one"));
53 EXPECT_EQ(c.size(), 1);
54 EXPECT_TRUE(c.insert(
"two"));
55 EXPECT_EQ(c.size(), 2);
58 EXPECT_EQ(c.size(), 2);
59 EXPECT_TRUE(c.touchIfExists(
"two"));
62 EXPECT_EQ(c.size(), 1);
69 EXPECT_TRUE(c.insert(
"one"));
71 EXPECT_TRUE(c.insert(
"two"));
73 EXPECT_TRUE(c.insert(
"three"));
75 EXPECT_EQ(c.size(), 3);
77 EXPECT_LT(c.size(), 3);
A generic endpoint for log messages.
static TestSink & instance()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::uint32_t LedgerIndex
A ledger index.
TEST_F(HardenedHashTest, user_types)
beast::ManualClock< std::chrono::steady_clock > TestStopwatch
A manual Stopwatch for unit tests.