summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/QA')
-rw-r--r--Swiften/QA/ClientTest/ClientTest.cpp2
-rw-r--r--Swiften/QA/DNSSDTest/DNSSDTest.cpp12
-rw-r--r--Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp2
-rw-r--r--Swiften/QA/NetworkTest/BoostConnectionTest.cpp2
-rw-r--r--Swiften/QA/NetworkTest/DomainNameResolverTest.cpp14
-rw-r--r--Swiften/QA/ReconnectTest/ReconnectTest.cpp2
-rw-r--r--Swiften/QA/StorageTest/FileReadBytestreamTest.cpp4
-rw-r--r--Swiften/QA/StorageTest/VCardFileStorageTest.cpp5
-rw-r--r--Swiften/QA/TLSTest/CertificateTest.cpp14
9 files changed, 29 insertions, 28 deletions
diff --git a/Swiften/QA/ClientTest/ClientTest.cpp b/Swiften/QA/ClientTest/ClientTest.cpp
index 0fb02ad..35bb096 100644
--- a/Swiften/QA/ClientTest/ClientTest.cpp
+++ b/Swiften/QA/ClientTest/ClientTest.cpp
@@ -59,7 +59,7 @@ int main(int, char**) {
return -1;
}
- client = new Swift::Client(JID(jid), String(pass), &networkFactories);
+ client = new Swift::Client(JID(jid), std::string(pass), &networkFactories);
ClientXMLTracer* tracer = new ClientXMLTracer(client);
client->onConnected.connect(&handleConnected);
client->setAlwaysTrustCertificates();
diff --git a/Swiften/QA/DNSSDTest/DNSSDTest.cpp b/Swiften/QA/DNSSDTest/DNSSDTest.cpp
index 7aa7b5e..1bf0965 100644
--- a/Swiften/QA/DNSSDTest/DNSSDTest.cpp
+++ b/Swiften/QA/DNSSDTest/DNSSDTest.cpp
@@ -65,18 +65,18 @@ class DNSSDTest : public CppUnit::TestFixture {
// Check that our registered queries are correct
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>((registered.size())));
- CPPUNIT_ASSERT_EQUAL(String("DNSSDTest"), registered[0].getName());
- CPPUNIT_ASSERT_EQUAL(String("local"), registered[0].getDomain());
- CPPUNIT_ASSERT_EQUAL(String("_presence._tcp"), registered[0].getType());
+ CPPUNIT_ASSERT_EQUAL(std::string("DNSSDTest"), registered[0].getName());
+ CPPUNIT_ASSERT_EQUAL(std::string("local"), registered[0].getDomain());
+ CPPUNIT_ASSERT_EQUAL(std::string("_presence._tcp"), registered[0].getType());
// Check that our browse query discovered us
std::sort(added.begin(), added.end());
CPPUNIT_ASSERT(added.size() >= 1);
//for (size_t i = 0; i < added.size(); ++i) {
for (size_t i = 0; i < added.size(); ++i) {
- CPPUNIT_ASSERT_EQUAL(String("DNSSDTest"), added[i].getName());
- CPPUNIT_ASSERT_EQUAL(String("local"), added[i].getDomain());
- CPPUNIT_ASSERT_EQUAL(String("_presence._tcp"), added[i].getType());
+ CPPUNIT_ASSERT_EQUAL(std::string("DNSSDTest"), added[i].getName());
+ CPPUNIT_ASSERT_EQUAL(std::string("local"), added[i].getDomain());
+ CPPUNIT_ASSERT_EQUAL(std::string("_presence._tcp"), added[i].getType());
CPPUNIT_ASSERT(added[i].getNetworkInterfaceID() != 0);
}
diff --git a/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp
index 57e7a5a..82a8be2 100644
--- a/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp
+++ b/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp
@@ -8,7 +8,7 @@
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <boost/shared_ptr.hpp>
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/Network/BoostConnectionServer.h"
#include "Swiften/Network/BoostIOServiceThread.h"
#include "Swiften/EventLoop/DummyEventLoop.h"
diff --git a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp
index 61572a0..928e3db 100644
--- a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp
+++ b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp
@@ -9,7 +9,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/smart_ptr/make_shared.hpp>
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/Base/sleep.h"
#include "Swiften/Network/BoostConnection.h"
#include "Swiften/Network/HostAddress.h"
diff --git a/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp b/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp
index b0316fe..a0a7e7b 100644
--- a/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp
+++ b/Swiften/QA/NetworkTest/DomainNameResolverTest.cpp
@@ -11,7 +11,7 @@
#include <algorithm>
#include "Swiften/Base/sleep.h"
-#include "Swiften/Base/String.h"
+#include <string>
#include "Swiften/Base/ByteArray.h"
#include "Swiften/Network/PlatformDomainNameResolver.h"
#include "Swiften/Network/DomainNameAddressQuery.h"
@@ -147,19 +147,19 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
waitForResults();
CPPUNIT_ASSERT_EQUAL(4, static_cast<int>(serviceQueryResult.size()));
- CPPUNIT_ASSERT_EQUAL(String("xmpp1.test.swift.im"), serviceQueryResult[0].hostname);
+ CPPUNIT_ASSERT_EQUAL(std::string("xmpp1.test.swift.im"), serviceQueryResult[0].hostname);
CPPUNIT_ASSERT_EQUAL(5000, serviceQueryResult[0].port);
CPPUNIT_ASSERT_EQUAL(0, serviceQueryResult[0].priority);
CPPUNIT_ASSERT_EQUAL(1, serviceQueryResult[0].weight);
- CPPUNIT_ASSERT_EQUAL(String("xmpp-invalid.test.swift.im"), serviceQueryResult[1].hostname);
+ CPPUNIT_ASSERT_EQUAL(std::string("xmpp-invalid.test.swift.im"), serviceQueryResult[1].hostname);
CPPUNIT_ASSERT_EQUAL(5000, serviceQueryResult[1].port);
CPPUNIT_ASSERT_EQUAL(1, serviceQueryResult[1].priority);
CPPUNIT_ASSERT_EQUAL(100, serviceQueryResult[1].weight);
- CPPUNIT_ASSERT_EQUAL(String("xmpp3.test.swift.im"), serviceQueryResult[2].hostname);
+ CPPUNIT_ASSERT_EQUAL(std::string("xmpp3.test.swift.im"), serviceQueryResult[2].hostname);
CPPUNIT_ASSERT_EQUAL(5000, serviceQueryResult[2].port);
CPPUNIT_ASSERT_EQUAL(3, serviceQueryResult[2].priority);
CPPUNIT_ASSERT_EQUAL(100, serviceQueryResult[2].weight);
- CPPUNIT_ASSERT_EQUAL(String("xmpp2.test.swift.im"), serviceQueryResult[3].hostname);
+ CPPUNIT_ASSERT_EQUAL(std::string("xmpp2.test.swift.im"), serviceQueryResult[3].hostname);
CPPUNIT_ASSERT_EQUAL(5000, serviceQueryResult[3].port);
CPPUNIT_ASSERT_EQUAL(5, serviceQueryResult[3].priority);
CPPUNIT_ASSERT_EQUAL(100, serviceQueryResult[3].weight);
@@ -169,7 +169,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
}
private:
- boost::shared_ptr<DomainNameAddressQuery> createAddressQuery(const String& domain) {
+ boost::shared_ptr<DomainNameAddressQuery> createAddressQuery(const std::string& domain) {
boost::shared_ptr<DomainNameAddressQuery> result = resolver->createAddressQuery(domain);
result->onResult.connect(boost::bind(&DomainNameResolverTest::handleAddressQueryResult, this, _1, _2));
return result;
@@ -183,7 +183,7 @@ class DomainNameResolverTest : public CppUnit::TestFixture {
resultsAvailable = true;
}
- boost::shared_ptr<DomainNameServiceQuery> createServiceQuery(const String& domain) {
+ boost::shared_ptr<DomainNameServiceQuery> createServiceQuery(const std::string& domain) {
boost::shared_ptr<DomainNameServiceQuery> result = resolver->createServiceQuery(domain);
result->onResult.connect(boost::bind(&DomainNameResolverTest::handleServiceQueryResult, this, _1));
return result;
diff --git a/Swiften/QA/ReconnectTest/ReconnectTest.cpp b/Swiften/QA/ReconnectTest/ReconnectTest.cpp
index e74ae27..117cfa3 100644
--- a/Swiften/QA/ReconnectTest/ReconnectTest.cpp
+++ b/Swiften/QA/ReconnectTest/ReconnectTest.cpp
@@ -61,7 +61,7 @@ int main(int, char**) {
}
JID jid(jidChars);
- String pass(passChars);
+ std::string pass(passChars);
client_ = new Swift::Client(jid, pass);
handleTick(boost::shared_ptr<BoostTimer>());
diff --git a/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp b/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp
index b8e9fd4..925c775 100644
--- a/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp
+++ b/Swiften/QA/StorageTest/FileReadBytestreamTest.cpp
@@ -34,7 +34,7 @@ class FileReadBytestreamTest : public CppUnit::TestFixture {
ByteArray result = testling->read(10);
- CPPUNIT_ASSERT_EQUAL(String("/*\n * Copy"), result.toString());
+ CPPUNIT_ASSERT_EQUAL(std::string("/*\n * Copy"), result.toString());
}
void testRead_Twice() {
@@ -43,7 +43,7 @@ class FileReadBytestreamTest : public CppUnit::TestFixture {
testling->read(10);
ByteArray result = testling->read(10);
- CPPUNIT_ASSERT_EQUAL(String("right (c) "), result.toString());
+ CPPUNIT_ASSERT_EQUAL(std::string("right (c) "), result.toString());
}
void testIsFinished_NotFinished() {
diff --git a/Swiften/QA/StorageTest/VCardFileStorageTest.cpp b/Swiften/QA/StorageTest/VCardFileStorageTest.cpp
index 7ef1fd5..992ee50 100644
--- a/Swiften/QA/StorageTest/VCardFileStorageTest.cpp
+++ b/Swiften/QA/StorageTest/VCardFileStorageTest.cpp
@@ -6,6 +6,7 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <boost/algorithm/string.hpp>
#include "Swiften/VCards/VCardFileStorage.h"
#include "Swiften/JID/JID.h"
@@ -44,7 +45,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(boost::filesystem::exists(vcardFile));
ByteArray data;
data.readFromFile(vcardFile.string());
- CPPUNIT_ASSERT(data.toString().beginsWith("<vCard xmlns=\"vcard-temp\">"));
+ CPPUNIT_ASSERT(boost::starts_with(data.toString(), "<vCard xmlns=\"vcard-temp\">"));
}
void testGetVCard() {
@@ -54,7 +55,7 @@ class VCardFileStorageTest : public CppUnit::TestFixture {
testling->setVCard(JID("alice@wonderland.lit"), vcard);
VCard::ref result = testling->getVCard(JID("alice@wonderland.lit"));
- CPPUNIT_ASSERT_EQUAL(String("Alice In Wonderland"), result->getFullName());
+ CPPUNIT_ASSERT_EQUAL(std::string("Alice In Wonderland"), result->getFullName());
}
void testGetVCard_FileDoesNotExist() {
diff --git a/Swiften/QA/TLSTest/CertificateTest.cpp b/Swiften/QA/TLSTest/CertificateTest.cpp
index 769272b..0f37fde 100644
--- a/Swiften/QA/TLSTest/CertificateTest.cpp
+++ b/Swiften/QA/TLSTest/CertificateTest.cpp
@@ -42,7 +42,7 @@ class CertificateTest : public CppUnit::TestFixture {
void testConstructFromDER() {
Certificate::ref testling = certificateFactory->createCertificateFromDER(certificateData);
- CPPUNIT_ASSERT_EQUAL(String("*.jabber.org"), testling->getCommonNames()[0]);
+ CPPUNIT_ASSERT_EQUAL(std::string("*.jabber.org"), testling->getCommonNames()[0]);
}
void testToDER() {
@@ -55,7 +55,7 @@ class CertificateTest : public CppUnit::TestFixture {
void testGetSubjectName() {
Certificate::ref testling = certificateFactory->createCertificateFromDER(certificateData);
- CPPUNIT_ASSERT_EQUAL(String("/description=114072-VMk8pdi1aj5kTXxO/C=US/ST=Colorado/L=Denver/O=Peter Saint-Andre/OU=StartCom Trusted Certificate Member/CN=*.jabber.org/emailAddress=hostmaster@jabber.org"), testling->getSubjectName());
+ CPPUNIT_ASSERT_EQUAL(std::string("/description=114072-VMk8pdi1aj5kTXxO/C=US/ST=Colorado/L=Denver/O=Peter Saint-Andre/OU=StartCom Trusted Certificate Member/CN=*.jabber.org/emailAddress=hostmaster@jabber.org"), testling->getSubjectName());
}
*/
@@ -63,29 +63,29 @@ class CertificateTest : public CppUnit::TestFixture {
Certificate::ref testling = certificateFactory->createCertificateFromDER(certificateData);
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(testling->getCommonNames().size()));
- CPPUNIT_ASSERT_EQUAL(String("*.jabber.org"), testling->getCommonNames()[0]);
+ CPPUNIT_ASSERT_EQUAL(std::string("*.jabber.org"), testling->getCommonNames()[0]);
}
void testGetSRVNames() {
Certificate::ref testling = certificateFactory->createCertificateFromDER(certificateData);
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(testling->getSRVNames().size()));
- CPPUNIT_ASSERT_EQUAL(String("*.jabber.org"), testling->getSRVNames()[0]);
+ CPPUNIT_ASSERT_EQUAL(std::string("*.jabber.org"), testling->getSRVNames()[0]);
}
void testGetDNSNames() {
Certificate::ref testling = certificateFactory->createCertificateFromDER(certificateData);
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(testling->getDNSNames().size()));
- CPPUNIT_ASSERT_EQUAL(String("*.jabber.org"), testling->getDNSNames()[0]);
- CPPUNIT_ASSERT_EQUAL(String("jabber.org"), testling->getDNSNames()[1]);
+ CPPUNIT_ASSERT_EQUAL(std::string("*.jabber.org"), testling->getDNSNames()[0]);
+ CPPUNIT_ASSERT_EQUAL(std::string("jabber.org"), testling->getDNSNames()[1]);
}
void testGetXMPPAddresses() {
Certificate::ref testling = certificateFactory->createCertificateFromDER(certificateData);
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(testling->getXMPPAddresses().size()));
- CPPUNIT_ASSERT_EQUAL(String("*.jabber.org"), testling->getXMPPAddresses()[0]);
+ CPPUNIT_ASSERT_EQUAL(std::string("*.jabber.org"), testling->getXMPPAddresses()[0]);
}
private: