diff --git a/src/AuthConfig.cc b/src/AuthConfig.cc index ec80b99f..470aa0b9 100644 --- a/src/AuthConfig.cc +++ b/src/AuthConfig.cc @@ -51,7 +51,10 @@ AuthConfig::~AuthConfig() {} std::string AuthConfig::getAuthText() const { - return strconcat(user_, ":", password_); + std::string s = user_; + s += ":"; + s += password_; + return s; } std::ostream& operator<<(std::ostream& o, const AuthConfigHandle& authConfig) diff --git a/src/BtBitfieldMessage.cc b/src/BtBitfieldMessage.cc index de4cece0..6992d281 100644 --- a/src/BtBitfieldMessage.cc +++ b/src/BtBitfieldMessage.cc @@ -119,7 +119,10 @@ size_t BtBitfieldMessage::getMessageLength() { } std::string BtBitfieldMessage::toString() const { - return strconcat(NAME, " ", util::toHex(bitfield_, bitfieldLength_)); + std::string s = NAME; + s += " "; + s += util::toHex(bitfield_, bitfieldLength_); + return s; } } // namespace aria2 diff --git a/src/BtExtendedMessage.cc b/src/BtExtendedMessage.cc index 12128394..103bd64e 100644 --- a/src/BtExtendedMessage.cc +++ b/src/BtExtendedMessage.cc @@ -90,7 +90,10 @@ bool BtExtendedMessage::sendPredicate() const } std::string BtExtendedMessage::toString() const { - return strconcat(NAME, " ", extensionMessage_->toString()); + std::string s = NAME; + s += " "; + s += extensionMessage_->toString(); + return s; } BtExtendedMessageHandle diff --git a/src/BtHandshakeMessage.cc b/src/BtHandshakeMessage.cc index d30601d9..bd441fee 100644 --- a/src/BtHandshakeMessage.cc +++ b/src/BtHandshakeMessage.cc @@ -103,10 +103,13 @@ size_t BtHandshakeMessage::getMessageLength() { } std::string BtHandshakeMessage::toString() const { - return strconcat(NAME, " peerId=", - util::percentEncode(peerId_, PEER_ID_LENGTH), - ", reserved=", - util::toHex(reserved_, RESERVED_LENGTH)); + char buf[256]; + snprintf(buf, sizeof(buf), + "%s peerId=%s, reserved=%s", + NAME.c_str(), + util::percentEncode(peerId_, PEER_ID_LENGTH).c_str(), + util::toHex(reserved_, RESERVED_LENGTH).c_str()); + return buf; } bool BtHandshakeMessage::isFastExtensionSupported() const { diff --git a/src/BtPieceMessage.cc b/src/BtPieceMessage.cc index b58ab647..7b563699 100644 --- a/src/BtPieceMessage.cc +++ b/src/BtPieceMessage.cc @@ -213,8 +213,13 @@ void BtPieceMessage::pushPieceData(off_t offset, size_t length) const std::string BtPieceMessage::toString() const { - return strconcat(NAME, " index=", util::itos(index_), ", begin=", - util::itos(begin_), ", length=", util::itos(blockLength_)); + char buf[256]; + snprintf(buf, sizeof(buf), "%s index=%lu, begin=%u, length=%lu", + NAME.c_str(), + static_cast(index_), + begin_, + static_cast(blockLength_)); + return buf; } bool BtPieceMessage::checkPieceHash(const SharedHandle& piece) diff --git a/src/BtPortMessage.cc b/src/BtPortMessage.cc index 0e13b061..4f904245 100644 --- a/src/BtPortMessage.cc +++ b/src/BtPortMessage.cc @@ -118,7 +118,9 @@ size_t BtPortMessage::getMessageLength() { } std::string BtPortMessage::toString() const { - return strconcat(NAME, " port=", util::uitos(port_)); + char buf[256]; + snprintf(buf, sizeof(buf), "%s port=%u", NAME.c_str(), port_); + return buf; } void BtPortMessage::setLocalNode(DHTNode* localNode) diff --git a/src/Cookie.cc b/src/Cookie.cc index 40cb36f2..5dc8db54 100644 --- a/src/Cookie.cc +++ b/src/Cookie.cc @@ -110,7 +110,10 @@ Cookie& Cookie::operator=(const Cookie& c) std::string Cookie::toString() const { - return strconcat(name_, '=', value_); + std::string s = name_; + s += "="; + s += value_; + return s; } bool Cookie::match diff --git a/src/DHTAnnouncePeerMessage.cc b/src/DHTAnnouncePeerMessage.cc index da4fb533..85c381a5 100644 --- a/src/DHTAnnouncePeerMessage.cc +++ b/src/DHTAnnouncePeerMessage.cc @@ -129,9 +129,13 @@ void DHTAnnouncePeerMessage::setTokenTracker(DHTTokenTracker* tokenTracker) std::string DHTAnnouncePeerMessage::toStringOptional() const { - return strconcat("token=", util::toHex(token_), - ", info_hash=", util::toHex(infoHash_, INFO_HASH_LENGTH), - ", tcpPort=", util::uitos(tcpPort_)); + char buf[256]; + snprintf(buf, sizeof(buf), + "token=%s, info_hash=%s, tcpPort=%u", + util::toHex(token_).c_str(), + util::toHex(infoHash_, INFO_HASH_LENGTH).c_str(), + tcpPort_); + return buf; } } // namespace aria2 diff --git a/src/DHTGetPeersReplyMessage.cc b/src/DHTGetPeersReplyMessage.cc index 76c525c7..7564df56 100644 --- a/src/DHTGetPeersReplyMessage.cc +++ b/src/DHTGetPeersReplyMessage.cc @@ -158,9 +158,13 @@ void DHTGetPeersReplyMessage::accept(DHTMessageCallback* callback) std::string DHTGetPeersReplyMessage::toStringOptional() const { - return strconcat("token=", util::toHex(token_), - ", values=", util::uitos(values_.size()), - ", nodes=", util::uitos(closestKNodes_.size())); + char buf[256]; + snprintf(buf, sizeof(buf), + "token=%s, values=%lu, nodes=%lu", + util::toHex(token_).c_str(), + static_cast(values_.size()), + static_cast(closestKNodes_.size())); + return buf; } } // namespace aria2 diff --git a/src/DHTNode.cc b/src/DHTNode.cc index b04959ae..967bd9a8 100644 --- a/src/DHTNode.cc +++ b/src/DHTNode.cc @@ -117,10 +117,15 @@ void DHTNode::timeout() std::string DHTNode::toString() const { - return strconcat("DHTNode ID=", util::toHex(id_, DHT_ID_LENGTH), - ", Host=", ipaddr_, ":", util::uitos(port_), - ", Condition=", util::uitos(condition_), - ", RTT=", util::uitos(rtt_)); + char buf[256]; + snprintf(buf, sizeof(buf), + "DHTNode ID=%s, Host=%s(%u), Condition=%u, RTT=%u", + util::toHex(id_, DHT_ID_LENGTH).c_str(), + ipaddr_.c_str(), + port_, + condition_, + rtt_); + return buf; } void DHTNode::setID(const unsigned char* id) diff --git a/src/DHTQueryMessage.cc b/src/DHTQueryMessage.cc index 61e3fba6..3f03fa97 100644 --- a/src/DHTQueryMessage.cc +++ b/src/DHTQueryMessage.cc @@ -68,20 +68,17 @@ bool DHTQueryMessage::isReply() const std::string DHTQueryMessage::toString() const { - std::string s = strconcat - ("dht query ", getMessageType(), - " TransactionID=", util::toHex(getTransactionID()), - " Remote:", getRemoteNode()->getIPAddress(), - ":", util::uitos(getRemoteNode()->getPort()), - ", id=", util::toHex(getRemoteNode()->getID(), DHT_ID_LENGTH), - ", "); - if(!getVersion().empty()) { - s += "v="; - s += util::torrentPercentEncode(getVersion()); - s += ", "; - } - s += toStringOptional(); - return s; + char buf[256]; + snprintf(buf, sizeof(buf), + "dht query %s TransactionID=%s Remote:%s(%u), id=%s, v=%s, %s", + getMessageType().c_str(), + util::toHex(getTransactionID()).c_str(), + getRemoteNode()->getIPAddress().c_str(), + getRemoteNode()->getPort(), + util::toHex(getRemoteNode()->getID(), DHT_ID_LENGTH).c_str(), + util::torrentPercentEncode(getVersion()).c_str(), + toStringOptional().c_str()); + return buf; } } // namespace aria2 diff --git a/src/DHTResponseMessage.cc b/src/DHTResponseMessage.cc index 03fcbde7..906eef7d 100644 --- a/src/DHTResponseMessage.cc +++ b/src/DHTResponseMessage.cc @@ -65,20 +65,17 @@ bool DHTResponseMessage::isReply() const std::string DHTResponseMessage::toString() const { - std::string s = strconcat - ("dht response ", getMessageType(), - " TransactionID=", util::toHex(getTransactionID()), - " Remote:", getRemoteNode()->getIPAddress(), - ":", util::uitos(getRemoteNode()->getPort()), - ", id=", util::toHex(getRemoteNode()->getID(), DHT_ID_LENGTH), - ", "); - if(!getVersion().empty()) { - s += "v="; - s += util::torrentPercentEncode(getVersion()); - s += ", "; - } - s += toStringOptional(); - return s; + char buf[256]; + snprintf(buf, sizeof(buf), + "dht response %s TransactionID=%s Remote:%s(%u), id=%s, v=%s, %s", + getMessageType().c_str(), + util::toHex(getTransactionID()).c_str(), + getRemoteNode()->getIPAddress().c_str(), + getRemoteNode()->getPort(), + util::toHex(getRemoteNode()->getID(), DHT_ID_LENGTH).c_str(), + util::torrentPercentEncode(getVersion()).c_str(), + toStringOptional().c_str()); + return buf; } } // namespace aria2 diff --git a/src/DHTUnknownMessage.cc b/src/DHTUnknownMessage.cc index b5facb43..365f78d3 100644 --- a/src/DHTUnknownMessage.cc +++ b/src/DHTUnknownMessage.cc @@ -89,10 +89,13 @@ std::string DHTUnknownMessage::toString() const sampleLength = length_; } std::string sample(&data_[0], &data_[sampleLength]); - - return strconcat("dht unknown Remote:", ipaddr_, ":", util::uitos(port_), - " length=", util::uitos(length_), - ", first 8 bytes(hex)=", util::toHex(sample)); + char buf[256]; + snprintf(buf, sizeof(buf), + "dht unknown Remote:%s(%u) length=%lu, first 8 bytes(hex)=%s", + ipaddr_.c_str(), port_, + static_cast(length_), + util::toHex(data_, sampleLength).c_str()); + return buf; } } // namespace aria2 diff --git a/src/FtpNegotiationCommand.cc b/src/FtpNegotiationCommand.cc index 4d2bc719..0fc22d4c 100644 --- a/src/FtpNegotiationCommand.cc +++ b/src/FtpNegotiationCommand.cc @@ -723,8 +723,11 @@ bool FtpNegotiationCommand::sendTunnelRequest() httpRequest->setUserAgent(getOption()->get(PREF_USER_AGENT)); SharedHandle req(new Request()); // Construct fake URI in order to use HttpRequest - req->setUri(strconcat("ftp://", dataConnAddr_.first, - A2STR::COLON_C, util::uitos(dataConnAddr_.second))); + // TODO Handle IPv6 address; it must be enclosed with []. + char fakeUriBuf[1024]; + snprintf(fakeUriBuf, sizeof(fakeUriBuf), "ftp://%s:%u", + dataConnAddr_.first.c_str(), dataConnAddr_.second); + req->setUri(fakeUriBuf); httpRequest->setRequest(req); httpRequest->setProxyRequest(createProxyRequest()); http_->sendProxyRequest(httpRequest); diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index 7f8191fb..8d3c5937 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -229,14 +229,17 @@ std::string HttpRequest::createRequest() } if(cookieStorage_) { std::string cookiesValue; + std::string path = getDir(); + if(getDir() == "/") { + path += getFile(); + } else { + path += "/"; + path += getFile(); + } std::vector cookies = - cookieStorage_->criteriaFind - (getHost(), - getDir() == A2STR::SLASH_C? - getDir()+getFile():strconcat(getDir(), A2STR::SLASH_C, getFile()), - Time().getTime(), - getProtocol() == Request::PROTO_HTTPS ? - true : false); + cookieStorage_->criteriaFind(getHost(), path, + Time().getTime(), + getProtocol() == Request::PROTO_HTTPS); for(std::vector::const_iterator itr = cookies.begin(), eoi = cookies.end(); itr != eoi; ++itr) { strappend(cookiesValue, (*itr).toString(), ";"); diff --git a/src/IndexBtMessage.cc b/src/IndexBtMessage.cc index 2480975b..108d5840 100644 --- a/src/IndexBtMessage.cc +++ b/src/IndexBtMessage.cc @@ -60,7 +60,11 @@ size_t IndexBtMessage::getMessageLength() std::string IndexBtMessage::toString() const { - return strconcat(getName(), " index=", util::itos(index_)); + char buf[256]; + snprintf(buf, sizeof(buf), "%s index=%lu", + getName().c_str(), + static_cast(index_)); + return buf; } } // namespace aria2 diff --git a/src/Piece.cc b/src/Piece.cc index a0698c3e..29b4cade 100644 --- a/src/Piece.cc +++ b/src/Piece.cc @@ -167,8 +167,11 @@ bool Piece::getAllMissingBlockIndexes } std::string Piece::toString() const { - return strconcat("piece: index=", util::itos(index_), - ", length=", util::itos(length_)); + char buf[256]; + snprintf(buf, sizeof(buf), "piece: index=%lu, length=%lu", + static_cast(index_), + static_cast(length_)); + return buf; } void Piece::reconfigure(size_t length) diff --git a/src/RangeBtMessage.cc b/src/RangeBtMessage.cc index b5318810..51c75c2e 100644 --- a/src/RangeBtMessage.cc +++ b/src/RangeBtMessage.cc @@ -72,9 +72,14 @@ size_t RangeBtMessage::getMessageLength() std::string RangeBtMessage::toString() const { - return strconcat(getName(), " index=", util::uitos(index_), - ", begin=", util::uitos(begin_), - ", length=", util::uitos(length_)); + char buf[256]; + snprintf(buf, sizeof(buf), + "%s index=%lu, begin=%u, length=%lu", + getName().c_str(), + static_cast(index_), + begin_, + static_cast(length_)); + return buf; } } // namespace aria2 diff --git a/src/Request.cc b/src/Request.cc index 7c80aa18..5732f391 100644 --- a/src/Request.cc +++ b/src/Request.cc @@ -163,7 +163,10 @@ const SharedHandle& Request::initPeerStat() std::string Request::getURIHost() const { if(isIPv6LiteralAddress()) { - return strconcat("[", getHost(), "]"); + std::string s = "["; + s += getHost(); + s += "]"; + return s; } else { return getHost(); } diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc index a622d8a5..35cbb737 100644 --- a/src/RequestGroup.cc +++ b/src/RequestGroup.cc @@ -793,7 +793,10 @@ bool RequestGroup::tryAutoFileRenaming() return false; } for(unsigned int i = 1; i < 10000; ++i) { - File newfile(strconcat(filepath, A2STR::DOT_C, util::uitos(i))); + std::string newfilename = filepath; + newfilename += "."; + newfilename += util::uitos(i); + File newfile(newfilename); File ctrlfile(newfile.getPath()+DefaultBtProgressInfoFile::getSuffix()); if(!newfile.exists() || (newfile.exists() && ctrlfile.exists())) { downloadContext_->getFirstFileEntry()->setPath(newfile.getPath()); diff --git a/src/UTMetadataDataExtensionMessage.cc b/src/UTMetadataDataExtensionMessage.cc index b5d63043..e63264a3 100644 --- a/src/UTMetadataDataExtensionMessage.cc +++ b/src/UTMetadataDataExtensionMessage.cc @@ -71,7 +71,10 @@ std::string UTMetadataDataExtensionMessage::getPayload() std::string UTMetadataDataExtensionMessage::toString() const { - return strconcat("ut_metadata data piece=", util::uitos(getIndex())); + char buf[256]; + snprintf(buf, sizeof(buf), "ut_metadata data piece=%lu", + static_cast(getIndex())); + return buf; } void UTMetadataDataExtensionMessage::doReceivedAction() diff --git a/src/UTMetadataRejectExtensionMessage.cc b/src/UTMetadataRejectExtensionMessage.cc index 4221b794..8f65708a 100644 --- a/src/UTMetadataRejectExtensionMessage.cc +++ b/src/UTMetadataRejectExtensionMessage.cc @@ -54,7 +54,10 @@ std::string UTMetadataRejectExtensionMessage::getPayload() std::string UTMetadataRejectExtensionMessage::toString() const { - return strconcat("ut_metadata reject piece=", util::uitos(getIndex())); + char buf[256]; + snprintf(buf, sizeof(buf), "ut_metadata reject piece=%lu", + static_cast(getIndex())); + return buf; } void UTMetadataRejectExtensionMessage::doReceivedAction() diff --git a/src/UTMetadataRequestExtensionMessage.cc b/src/UTMetadataRequestExtensionMessage.cc index 18315444..8a2fd496 100644 --- a/src/UTMetadataRequestExtensionMessage.cc +++ b/src/UTMetadataRequestExtensionMessage.cc @@ -69,7 +69,10 @@ std::string UTMetadataRequestExtensionMessage::getPayload() std::string UTMetadataRequestExtensionMessage::toString() const { - return strconcat("ut_metadata request piece=", util::uitos(getIndex())); + char buf[256]; + snprintf(buf, sizeof(buf), "ut_metadata request piece=%lu", + static_cast(getIndex())); + return buf; } void UTMetadataRequestExtensionMessage::doReceivedAction() diff --git a/src/UTPexExtensionMessage.cc b/src/UTPexExtensionMessage.cc index fe0e99c6..f4cb0018 100644 --- a/src/UTPexExtensionMessage.cc +++ b/src/UTPexExtensionMessage.cc @@ -121,8 +121,11 @@ UTPexExtensionMessage::createCompactPeerListAndFlag std::string UTPexExtensionMessage::toString() const { - return strconcat("ut_pex added=", util::uitos(freshPeers_.size()), - ", dropped=", util::uitos(droppedPeers_.size())); + char buf[256]; + snprintf(buf, sizeof(buf), "ut_pex added=%lu, dropped=%lu", + static_cast(freshPeers_.size()), + static_cast(droppedPeers_.size())); + return buf; } void UTPexExtensionMessage::doReceivedAction() diff --git a/src/a2functional.h b/src/a2functional.h index 065afbb6..28b32ec6 100644 --- a/src/a2functional.h +++ b/src/a2functional.h @@ -283,109 +283,6 @@ std::string strjoin(InputIterator first, InputIterator last, return result; } -template -inline std::string strconcat(const T1& a1, const T2& a2) -{ - std::string s(a1); s += a2; return s; -} - -template -inline std::string strconcat(const T1& a1, const T2& a2, const T3& a3) -{ - std::string s(a1); s += a2; s += a3; return s; -} - -template -inline std::string -strconcat(const T1& a1, const T2& a2, const T3& a3, const T4& a4) -{ - std::string s(a1); s += a2; s += a3; s += a4; return s; -} - -template -inline std::string -strconcat(const T1& a1, const T2& a2, const T3& a3, const T4& a4, - const T5& a5) -{ - std::string s(a1); s += a2; s += a3; s += a4; s += a5; return s; -} - -template -inline std::string -strconcat(const T1& a1, const T2& a2, const T3& a3, const T4& a4, - const T5& a5, const T6& a6) -{ - std::string s(a1); s += a2; s += a3; s += a4; s += a5; s += a6; return s; -} - -template -inline std::string -strconcat(const T1& a1, const T2& a2, const T3& a3, const T4& a4, - const T5& a5, const T6& a6, const T7& a7) -{ - std::string s(a1); s += a2; s += a3; s += a4; s += a5; s += a6; s += a7; - return s; -} - -template -inline std::string -strconcat(const T1& a1, const T2& a2, const T3& a3, const T4& a4, - const T5& a5, const T6& a6, const T7& a7, const T8& a8) -{ - std::string s(a1); s += a2; s += a3; s += a4; s += a5; s += a6; s += a7; - s += a8; return s; -} - -template -inline std::string -strconcat(const T1& a1, const T2& a2, const T3& a3, const T4& a4, - const T5& a5, const T6& a6, const T7& a7, const T8& a8, - const T9& a9) -{ - std::string s(a1); s += a2; s += a3; s += a4; s += a5; s += a6; s += a7; - s += a8; s += a9; return s; -} - -template -inline std::string -strconcat(const T1& a1, const T2& a2, const T3& a3, const T4& a4, - const T5& a5, const T6& a6, const T7& a7, const T8& a8, - const T9& a9, const T10& a10) -{ - std::string s(a1); s += a2; s += a3; s += a4; s += a5; s += a6; s += a7; - s += a8; s += a9; s += a10; return s; -} - -template -inline std::string -strconcat(const T1& a1, const T2& a2, const T3& a3, const T4& a4, - const T5& a5, const T6& a6, const T7& a7, const T8& a8, - const T9& a9, const T10& a10, const T11& a11) -{ - std::string s(a1); s += a2; s += a3; s += a4; s += a5; s += a6; s += a7; - s += a8; s += a9; s += a10; s += a11; return s; -} - -template -inline std::string -strconcat(const T1& a1, const T2& a2, const T3& a3, const T4& a4, - const T5& a5, const T6& a6, const T7& a7, const T8& a8, - const T9& a9, const T10& a10, const T11& a11, - const T12& a12) -{ - std::string s(a1); s += a2; s += a3; s += a4; s += a5; s += a6; s += a7; - s += a8; s += a9; s += a10; s += a11; s += a12; return s; -} - template inline void strappend(std::string& base, const T1& a1, const T2& a2) { diff --git a/src/bittorrent_helper.cc b/src/bittorrent_helper.cc index 4c859f0a..0997270c 100644 --- a/src/bittorrent_helper.cc +++ b/src/bittorrent_helper.cc @@ -220,7 +220,8 @@ void extractFileEntries error_code::BITTORRENT_PARSE_ERROR); } } else { - utf8Name = strconcat(File(defaultName).getBasename(), ".file"); + utf8Name = File(defaultName).getBasename(); + utf8Name += ".file"; } } else { utf8Name = overrideName; @@ -951,8 +952,9 @@ std::string metadata2Torrent torrent += "13:announce-list"; torrent += bencode2::encode(&announceList); } - torrent += - strconcat("4:info", metadata, "e"); + torrent += "4:info"; + torrent += metadata; + torrent += "e"; return torrent; } diff --git a/src/util.cc b/src/util.cc index c9b64758..d923a20b 100644 --- a/src/util.cc +++ b/src/util.cc @@ -1367,11 +1367,16 @@ std::string applyDir(const std::string& dir, const std::string& relPath) { std::string s; if(dir.empty()) { - s = strconcat(A2STR::DOT_C, A2STR::SLASH_C, relPath); - } else if(dir == A2STR::SLASH_C) { - s = strconcat(A2STR::SLASH_C, relPath); + s = "./"; + s += relPath; } else { - s = strconcat(dir, A2STR::SLASH_C, relPath); + s = dir; + if(dir == "/") { + s += relPath; + } else { + s += "/"; + s += relPath; + } } #ifdef __MINGW32__ for(std::string::iterator i = s.begin(), eoi = s.end(); i != eoi; ++i) { diff --git a/test/DHTUnknownMessageTest.cc b/test/DHTUnknownMessageTest.cc index ea1e31de..4e399ec0 100644 --- a/test/DHTUnknownMessageTest.cc +++ b/test/DHTUnknownMessageTest.cc @@ -35,7 +35,7 @@ void DHTUnknownMessageTest::testToString() data.size(), ipaddr, port); - CPPUNIT_ASSERT_EQUAL(std::string("dht unknown Remote:192.168.0.1:6881 length=9, first 8 bytes(hex)=63686f636f6c6174"), msg.toString()); + CPPUNIT_ASSERT_EQUAL(std::string("dht unknown Remote:192.168.0.1(6881) length=9, first 8 bytes(hex)=63686f636f6c6174"), msg.toString()); } { // data.size() == 3 @@ -45,7 +45,7 @@ void DHTUnknownMessageTest::testToString() data.size(), ipaddr, port); - CPPUNIT_ASSERT_EQUAL(std::string("dht unknown Remote:192.168.0.1:6881 length=3, first 8 bytes(hex)=666f6f"), msg.toString()); + CPPUNIT_ASSERT_EQUAL(std::string("dht unknown Remote:192.168.0.1(6881) length=3, first 8 bytes(hex)=666f6f"), msg.toString()); } } diff --git a/test/SessionSerializerTest.cc b/test/SessionSerializerTest.cc index 883991c9..84f298a5 100644 --- a/test/SessionSerializerTest.cc +++ b/test/SessionSerializerTest.cc @@ -77,7 +77,7 @@ void SessionSerializerTest::testSave() std::getline(ss, line); CPPUNIT_ASSERT_EQUAL(std::string("http://error\t"), line); std::getline(ss, line); - CPPUNIT_ASSERT_EQUAL(strconcat(uris[0], "\t", uris[1], "\t"), line); + CPPUNIT_ASSERT_EQUAL(uris[0]+"\t"+uris[1]+"\t", line); std::getline(ss, line); CPPUNIT_ASSERT_EQUAL(std::string(" dir=/tmp"), line); std::getline(ss, line); diff --git a/test/a2functionalTest.cc b/test/a2functionalTest.cc index 0e9a816e..d4c77e07 100644 --- a/test/a2functionalTest.cc +++ b/test/a2functionalTest.cc @@ -14,7 +14,6 @@ class a2functionalTest:public CppUnit::TestFixture { CPPUNIT_TEST(testMemFunSh); CPPUNIT_TEST(testAdopt2nd); CPPUNIT_TEST(testStrjoin); - CPPUNIT_TEST(testStrconcat); CPPUNIT_TEST(testStrappend); CPPUNIT_TEST(testLeastRecentAccess); CPPUNIT_TEST_SUITE_END(); @@ -22,7 +21,6 @@ public: void testMemFunSh(); void testAdopt2nd(); void testStrjoin(); - void testStrconcat(); void testStrappend(); void testLeastRecentAccess(); @@ -100,11 +98,6 @@ void a2functionalTest::testStrjoin() strjoin(v.begin(), v.end(), " ")); } -void a2functionalTest::testStrconcat() -{ - CPPUNIT_ASSERT_EQUAL(std::string("X=3"), strconcat("X=", "3")); -} - void a2functionalTest::testStrappend() { std::string str = "X=";