Skip to content

Commit 925dbd3

Browse files
committed
[WIP] Checkpoint - diagnostic test log messages
1 parent 0e948a0 commit 925dbd3

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/test/app/ValidatorSite_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,11 @@ class ValidatorSite_test : public beast::unit_test::suite
707707
}
708708
};
709709

710+
// Quick hack for TrustedPublisherServer definition so I don't have to
711+
// make a cpp file
712+
// static
713+
std::atomic<int> TrustedPublisherServer::counter = 0;
714+
710715
BEAST_DEFINE_TESTSUITE_PRIO(ValidatorSite, app, ripple, 5);
711716

712717
} // namespace test

src/test/jtx/TrustedPublisherServer.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ class TrustedPublisherServer
164164
1)};
165165
}
166166

167+
static std::atomic<int> counter;
168+
int const myNumber;
169+
167170
// TrustedPublisherServer must be accessed through a shared_ptr.
168171
// This constructor is only public so std::make_shared has access.
169172
// The function`make_TrustedPublisherServer` should be used to create
@@ -190,7 +193,10 @@ class TrustedPublisherServer
190193
, useSSL_{useSSL}
191194
, publisherSecret_{randomSecretKey()}
192195
, publisherPublic_{derivePublicKey(KeyType::ed25519, publisherSecret_)}
196+
, myNumber(++counter)
193197
{
198+
std::cerr << "Creating TrustedPublisherServer #" << myNumber
199+
<< std::endl;
194200
auto const keys = randomKeyPair(KeyType::secp256k1);
195201
auto const manifest = makeManifestString(
196202
publisherPublic_, publisherSecret_, keys.first, keys.second, 1);
@@ -307,6 +313,9 @@ class TrustedPublisherServer
307313
~TrustedPublisherServer()
308314
{
309315
stop();
316+
std::cerr << "Destructing TrustedPublisherServer #" << myNumber
317+
<< std::endl;
318+
--counter;
310319
}
311320

312321
endpoint_type

0 commit comments

Comments
 (0)