summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-31 18:39:13 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-31 18:39:13 (GMT)
commit67d69026c64a96b4e0dc64391b8bdcf43a187fab (patch)
tree4dce2be022cc052c7744cb6af8d0f1eeb56850ce /Swiften/Network/UnitTest
parentb3e6f21953d5d4b55ab9ffde78e1a1ff2a59dad1 (diff)
downloadswift-67d69026c64a96b4e0dc64391b8bdcf43a187fab.zip
swift-67d69026c64a96b4e0dc64391b8bdcf43a187fab.tar.bz2
HostAddress: Add constructor from String.
Diffstat (limited to 'Swiften/Network/UnitTest')
-rw-r--r--Swiften/Network/UnitTest/HostAddressTest.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/Swiften/Network/UnitTest/HostAddressTest.cpp b/Swiften/Network/UnitTest/HostAddressTest.cpp
index b805647..50e9198 100644
--- a/Swiften/Network/UnitTest/HostAddressTest.cpp
+++ b/Swiften/Network/UnitTest/HostAddressTest.cpp
@@ -2,18 +2,23 @@
#include <cppunit/extensions/TestFactoryRegistry.h>
#include "Swiften/Network/HostAddress.h"
+#include "Swiften/Base/String.h"
using namespace Swift;
-class HostAddressTest : public CppUnit::TestFixture
-{
+class HostAddressTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(HostAddressTest);
+ CPPUNIT_TEST(testConstructor);
CPPUNIT_TEST(testToString);
CPPUNIT_TEST(testToString_IPv6);
CPPUNIT_TEST_SUITE_END();
public:
- HostAddressTest() {}
+ void testConstructor() {
+ HostAddress testling("192.168.1.254");
+
+ CPPUNIT_ASSERT_EQUAL(std::string("192.168.1.254"), testling.toString());
+ }
void testToString() {
unsigned char address[4] = {10, 0, 1, 253};