diff options
author | Joanna Hulboj <joanna.hulboj@isode.com> | 2019-10-03 08:11:09 (GMT) |
---|---|---|
committer | Joanna Hulboj <joanna.hulboj@isode.com> | 2019-10-03 09:09:08 (GMT) |
commit | df07a5e1e654c5fe4b513b8b0e41a392e9955cdf (patch) | |
tree | e864e06a81c85bb1876c59a2f7107a443ed0cc75 /Swiften/JID/UnitTest/JIDTest.cpp | |
parent | 6f5fa6a02eb7502a15afab70c91451b8142e2ac3 (diff) | |
download | swift-df07a5e1e654c5fe4b513b8b0e41a392e9955cdf.zip swift-df07a5e1e654c5fe4b513b8b0e41a392e9955cdf.tar.bz2 |
Treat numeric domain JID as invalid
DomainJID consisting of only numbers is not treated as valid.
Test-information:
Unit tests pass on Windows 10 and Ubuntu 18.04.1 LTS.
Change-Id: If23ba8b8ea2a3c72d6f6e3acec4f587166c14e61
Diffstat (limited to 'Swiften/JID/UnitTest/JIDTest.cpp')
-rw-r--r-- | Swiften/JID/UnitTest/JIDTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Swiften/JID/UnitTest/JIDTest.cpp b/Swiften/JID/UnitTest/JIDTest.cpp index 894378d..fc7583f 100644 --- a/Swiften/JID/UnitTest/JIDTest.cpp +++ b/Swiften/JID/UnitTest/JIDTest.cpp @@ -26,2 +26,3 @@ class JIDTest : public CppUnit::TestFixture CPPUNIT_TEST(testConstructorWithString_InvalidDomain); + CPPUNIT_TEST(testConstructorWithString_InvalidDomainOnlyDigits); CPPUNIT_TEST(testConstructorWithString_InvalidDomainEmptyLabel); @@ -164,2 +165,6 @@ class JIDTest : public CppUnit::TestFixture + void testConstructorWithString_InvalidDomainOnlyDigits() { + CPPUNIT_ASSERT(!JID("1234").isValid()); + } + void testConstructorWithString_InvalidDomainEmptyLabel() { |