diff options
| author | Nils Maier <maierman@web.de> | 2013-08-20 18:57:17 +0200 |
|---|---|---|
| committer | Nils Maier <maierman@web.de> | 2013-08-20 21:28:24 +0200 |
| commit | d8f44ef4f6c5ad86b08658ecba41a84b775b6e69 (patch) | |
| tree | d149687d1dc46fbd641735d71551e5990080e1fb /test | |
| parent | 9da17424c62ebabf7c407695e6990cdd9820ebc9 (diff) | |
Convert most 0/NULL pointers to nullptr
Courtesy of llvm cpp11-migrate 3.3
Diffstat (limited to 'test')
| -rw-r--r-- | test/DefaultBtProgressInfoFileTest.cc | 2 | ||||
| -rw-r--r-- | test/GZipDecoder.cc | 4 | ||||
| -rw-r--r-- | test/GrowSegmentTest.cc | 2 | ||||
| -rw-r--r-- | test/IndexedListTest.cc | 2 | ||||
| -rw-r--r-- | test/MultiDiskAdaptorTest.cc | 2 | ||||
| -rw-r--r-- | test/RpcMethodTest.cc | 2 | ||||
| -rw-r--r-- | test/SegmentTest.cc | 2 | ||||
| -rw-r--r-- | test/SocketCoreTest.cc | 4 | ||||
| -rw-r--r-- | test/TimeTest.cc | 2 | ||||
| -rw-r--r-- | test/UriSplitTest.cc | 44 |
10 files changed, 33 insertions, 33 deletions
diff --git a/test/DefaultBtProgressInfoFileTest.cc b/test/DefaultBtProgressInfoFileTest.cc index 9fefb8e4..974c0555 100644 --- a/test/DefaultBtProgressInfoFileTest.cc +++ b/test/DefaultBtProgressInfoFileTest.cc @@ -557,7 +557,7 @@ void DefaultBtProgressInfoFileTest::testUpdateFilename() std::shared_ptr<DownloadContext> dctx (new DownloadContext(1024, 81920, A2_TEST_DIR"/file1")); - DefaultBtProgressInfoFile infoFile(dctx, std::shared_ptr<MockPieceStorage>(), 0); + DefaultBtProgressInfoFile infoFile(dctx, std::shared_ptr<MockPieceStorage>(), nullptr); #ifdef ENABLE_BITTORRENT infoFile.setBtRuntime(btRuntime_); infoFile.setPeerStorage(peerStorage_); diff --git a/test/GZipDecoder.cc b/test/GZipDecoder.cc index a88faa2a..12aab74c 100644 --- a/test/GZipDecoder.cc +++ b/test/GZipDecoder.cc @@ -40,7 +40,7 @@ namespace aria2 { const std::string GZipDecoder::NAME("GZipDecoder"); -GZipDecoder::GZipDecoder():strm_(0), finished_(false) {} +GZipDecoder::GZipDecoder():strm_(nullptr), finished_(false) {} GZipDecoder::~GZipDecoder() { @@ -69,7 +69,7 @@ void GZipDecoder::release() if(strm_) { inflateEnd(strm_); delete strm_; - strm_ = 0; + strm_ = nullptr; } } diff --git a/test/GrowSegmentTest.cc b/test/GrowSegmentTest.cc index 97b0509c..c973a39e 100644 --- a/test/GrowSegmentTest.cc +++ b/test/GrowSegmentTest.cc @@ -37,7 +37,7 @@ void GrowSegmentTest::testClear() GrowSegment segment(std::shared_ptr<Piece>(new Piece())); segment.updateWrittenLength(32*1024); CPPUNIT_ASSERT_EQUAL(32*1024, segment.getWrittenLength()); - segment.clear(0); + segment.clear(nullptr); CPPUNIT_ASSERT_EQUAL(0, segment.getWrittenLength()); } diff --git a/test/IndexedListTest.cc b/test/IndexedListTest.cc index e208005b..23d19ab3 100644 --- a/test/IndexedListTest.cc +++ b/test/IndexedListTest.cc @@ -229,7 +229,7 @@ void IndexedListTest::testGet() int b = 1; list.push_back(123, &a); list.push_back(1, &b); - CPPUNIT_ASSERT_EQUAL((int*)0, list.get(1000)); + CPPUNIT_ASSERT_EQUAL((int*)nullptr, list.get(1000)); CPPUNIT_ASSERT_EQUAL(&a, list.get(123)); } diff --git a/test/MultiDiskAdaptorTest.cc b/test/MultiDiskAdaptorTest.cc index 001c9a54..75e748fe 100644 --- a/test/MultiDiskAdaptorTest.cc +++ b/test/MultiDiskAdaptorTest.cc @@ -270,7 +270,7 @@ void MultiDiskAdaptorTest::testResetDiskWriterEntries() void readFile(const std::string& filename, char* buf, int bufLength) { FILE* f = fopen(filename.c_str(), "r"); - if(f == NULL) { + if(f == nullptr) { CPPUNIT_FAIL(strerror(errno)); } int retval = fread(buf, bufLength, 1, f); diff --git a/test/RpcMethodTest.cc b/test/RpcMethodTest.cc index 902a1c3a..15a94b45 100644 --- a/test/RpcMethodTest.cc +++ b/test/RpcMethodTest.cc @@ -684,7 +684,7 @@ void RpcMethodTest::testChangeGlobalOption_withNotAllowedOption() void RpcMethodTest::testNoSuchMethod() { NoSuchMethodRpcMethod m; - auto res = m.execute(createReq("make.hamburger"), 0); + auto res = m.execute(createReq("make.hamburger"), nullptr); CPPUNIT_ASSERT_EQUAL(1, res.code); CPPUNIT_ASSERT_EQUAL(std::string("No such method: make.hamburger"), getString(downcast<Dict>(res.param), "faultString")); diff --git a/test/SegmentTest.cc b/test/SegmentTest.cc index 061cb891..0f32e310 100644 --- a/test/SegmentTest.cc +++ b/test/SegmentTest.cc @@ -68,7 +68,7 @@ void SegmentTest::testClear() PiecedSegment s(16*1024*10, p); s.updateWrittenLength(16*1024*10); CPPUNIT_ASSERT_EQUAL(16*1024*10, s.getWrittenLength()); - s.clear(0); + s.clear(nullptr); CPPUNIT_ASSERT_EQUAL(0, s.getWrittenLength()); } diff --git a/test/SocketCoreTest.cc b/test/SocketCoreTest.cc index 064a5141..6f44b093 100644 --- a/test/SocketCoreTest.cc +++ b/test/SocketCoreTest.cc @@ -87,7 +87,7 @@ void SocketCoreTest::testInetNtop() { std::string s = "192.168.0.1"; addrinfo* res; - CPPUNIT_ASSERT_EQUAL(0, callGetaddrinfo(&res, s.c_str(), 0, AF_INET, + CPPUNIT_ASSERT_EQUAL(0, callGetaddrinfo(&res, s.c_str(), nullptr, AF_INET, SOCK_STREAM, 0, 0)); std::unique_ptr<addrinfo, decltype(&freeaddrinfo)> resDeleter (res, freeaddrinfo); @@ -100,7 +100,7 @@ void SocketCoreTest::testInetNtop() { std::string s = "2001:db8::2:1"; addrinfo* res; - CPPUNIT_ASSERT_EQUAL(0, callGetaddrinfo(&res, s.c_str(), 0, AF_INET6, + CPPUNIT_ASSERT_EQUAL(0, callGetaddrinfo(&res, s.c_str(), nullptr, AF_INET6, SOCK_STREAM, 0, 0)); std::unique_ptr<addrinfo, decltype(&freeaddrinfo)> resDeleter (res, freeaddrinfo); diff --git a/test/TimeTest.cc b/test/TimeTest.cc index b1835716..0a56f21d 100644 --- a/test/TimeTest.cc +++ b/test/TimeTest.cc @@ -113,7 +113,7 @@ void TimeTest::testToHTTPDate() void TimeTest::testElapsed() { struct timeval now; - gettimeofday(&now, 0); + gettimeofday(&now, nullptr); { struct timeval tv = now; CPPUNIT_ASSERT(!Time(tv).elapsed(1)); diff --git a/test/UriSplitTest.cc b/test/UriSplitTest.cc index bb129091..3016031d 100644 --- a/test/UriSplitTest.cc +++ b/test/UriSplitTest.cc @@ -391,28 +391,28 @@ void UriSplitTest::testUriSplit() void UriSplitTest::testUriSplit_fail() { - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "h")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http:")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http:a")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http:/")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http:/a")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://:host")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://@user@host")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://user:")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://user:pass")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://user:65536")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://user:pass?")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://user:pass@host:65536")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://user:pass@host:x")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://user:pass@host:80x")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://user@")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://[]")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://[::")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://user[::1]")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://user[::1]x")); - CPPUNIT_ASSERT_EQUAL(-1, uri_split(NULL, "http://user:pass[::1]")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "h")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http:")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http:a")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http:/")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http:/a")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://:host")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://@user@host")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://user:")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://user:pass")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://user:65536")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://user:pass?")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://user:pass@host:65536")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://user:pass@host:x")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://user:pass@host:80x")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://user@")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://[]")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://[::")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://user[::1]")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://user[::1]x")); + CPPUNIT_ASSERT_EQUAL(-1, uri_split(nullptr, "http://user:pass[::1]")); } } // namespace aria2 |
