Browse Source

default parameter changed

cl-refactor
Vlad Gluhovsky 10 years ago
parent
commit
bdd86f768c
  1. 2
      libwhisper/WhisperHost.h
  2. 6
      test/libwhisper/whisperDB.cpp
  3. 6
      test/libwhisper/whisperTopic.cpp

2
libwhisper/WhisperHost.h

@ -48,7 +48,7 @@ class WhisperHost: public HostCapability<WhisperPeer>, public Interface, public
friend class WhisperPeer;
public:
WhisperHost(bool _useDB = true);
WhisperHost(bool _useDB = false);
virtual ~WhisperHost();
unsigned protocolVersion() const { return WhisperProtocolVersion; }
void cleanup(); ///< remove old messages

6
test/libwhisper/whisperDB.cpp

@ -132,7 +132,7 @@ BOOST_AUTO_TEST_CASE(messages)
{
p2p::Host h("Test");
auto wh = h.registerCapability(new WhisperHost());
auto wh = h.registerCapability(new WhisperHost(true));
preexisting = wh->all();
cnote << preexisting.size() << "preexisting messages in DB";
@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE(messages)
{
p2p::Host h("Test");
auto wh = h.registerCapability(new WhisperHost());
auto wh = h.registerCapability(new WhisperHost(true));
map<h256, Envelope> m2 = wh->all();
BOOST_REQUIRE_EQUAL(m1.size(), m2.size());
BOOST_REQUIRE_EQUAL(m1.size() - preexisting.size(), TestSize);
@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(corruptedData)
{
p2p::Host h("Test");
auto wh = h.registerCapability(new WhisperHost());
auto wh = h.registerCapability(new WhisperHost(true));
m = wh->all();
BOOST_REQUIRE(m.end() == m.find(x));
}

6
test/libwhisper/whisperTopic.cpp

@ -223,7 +223,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
// Host must be configured not to share peers.
Host host1("Forwarder", NetworkPreferences("127.0.0.1", 30305, false));
host1.setIdealPeerCount(1);
auto whost1 = host1.registerCapability(new WhisperHost(false));
auto whost1 = host1.registerCapability(new WhisperHost());
host1.start();
while (!host1.haveNetwork())
this_thread::sleep_for(chrono::milliseconds(2));
@ -252,7 +252,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
{
Host host2("Sender", NetworkPreferences("127.0.0.1", 30300, false));
host2.setIdealPeerCount(1);
shared_ptr<WhisperHost> whost2 = host2.registerCapability(new WhisperHost(false));
shared_ptr<WhisperHost> whost2 = host2.registerCapability(new WhisperHost());
host2.start();
while (!host2.haveNetwork())
this_thread::sleep_for(chrono::milliseconds(2));
@ -269,7 +269,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
{
Host ph("Listener", NetworkPreferences("127.0.0.1", 30300, false));
ph.setIdealPeerCount(1);
shared_ptr<WhisperHost> wh = ph.registerCapability(new WhisperHost(false));
shared_ptr<WhisperHost> wh = ph.registerCapability(new WhisperHost());
ph.start();
while (!ph.haveNetwork())
this_thread::sleep_for(chrono::milliseconds(2));

Loading…
Cancel
Save