diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2016-05-31 13:51:11 -0400 |
---|---|---|
committer | Cory Fields <cory-nospam-@coryfields.com> | 2016-07-31 13:24:07 -0400 |
commit | f96c7c4d91f3c09d26658bc9c15aa561689fa2d4 (patch) | |
tree | 4fc6bff63eff752e4791ae3fb64de77b427afeee /src/test/net_tests.cpp | |
parent | 31d6b1d5f0414d8b356d8cb9c99961d8a04d6c0a (diff) |
net: Split resolving out of CService
Diffstat (limited to 'src/test/net_tests.cpp')
-rw-r--r-- | src/test/net_tests.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index 511073499e..fca1a16b2d 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -51,7 +51,9 @@ public: int nUBuckets = ADDRMAN_NEW_BUCKET_COUNT ^ (1 << 30); s << nUBuckets; - CAddress addr = CAddress(CService("252.1.1.1", 7777), NODE_NONE); + CService serv; + Lookup("252.1.1.1", serv, 7777, false); + CAddress addr = CAddress(serv, NODE_NONE); CNetAddr resolved; LookupHost("252.2.2.2", resolved, false); CAddrInfo info = CAddrInfo(addr, resolved); @@ -76,14 +78,17 @@ BOOST_AUTO_TEST_CASE(caddrdb_read) CAddrManUncorrupted addrmanUncorrupted; addrmanUncorrupted.MakeDeterministic(); - CService addr1 = CService("250.7.1.1", 8333); - CService addr2 = CService("250.7.2.2", 9999); - CService addr3 = CService("250.7.3.3", 9999); + CService addr1, addr2, addr3; + Lookup("250.7.1.1", addr1, 8333, false); + Lookup("250.7.2.2", addr2, 9999, false); + Lookup("250.7.3.3", addr3, 9999, false); // Add three addresses to new table. - addrmanUncorrupted.Add(CAddress(addr1, NODE_NONE), CService("252.5.1.1", 8333)); - addrmanUncorrupted.Add(CAddress(addr2, NODE_NONE), CService("252.5.1.1", 8333)); - addrmanUncorrupted.Add(CAddress(addr3, NODE_NONE), CService("252.5.1.1", 8333)); + CService source; + Lookup("252.5.1.1", source, 8333, false); + addrmanUncorrupted.Add(CAddress(addr1, NODE_NONE), source); + addrmanUncorrupted.Add(CAddress(addr2, NODE_NONE), source); + addrmanUncorrupted.Add(CAddress(addr3, NODE_NONE), source); // Test that the de-serialization does not throw an exception. CDataStream ssPeers1 = AddrmanToStream(addrmanUncorrupted); |