diff options
author | Vincent Richard <[email protected]> | 2013-04-26 20:47:51 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2013-04-26 20:47:51 +0000 |
commit | 5a3d88855b37666b3ea9102863b85ff137e5027e (patch) | |
tree | 8c710426f824c06e0014ea7b118029fb64ad1f74 /src | |
parent | Issue #36: added support for wildcard in Common Name when verifying host name... (diff) | |
download | vmime-5a3d88855b37666b3ea9102863b85ff137e5027e.tar.gz vmime-5a3d88855b37666b3ea9102863b85ff137e5027e.zip |
Added unit tests for IMAPTag. Initialize sequence number at 1.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/imap/IMAPConnection.cpp | 7 | ||||
-rw-r--r-- | src/net/imap/IMAPTag.cpp | 11 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/net/imap/IMAPConnection.cpp b/src/net/imap/IMAPConnection.cpp index 613b5328..066b5ab5 100644 --- a/src/net/imap/IMAPConnection.cpp +++ b/src/net/imap/IMAPConnection.cpp @@ -633,8 +633,6 @@ void IMAPConnection::send(bool tag, const string& what, bool end) if (tag) { - ++(*m_tag); - oss << string(*m_tag); oss << " "; } @@ -648,8 +646,6 @@ void IMAPConnection::send(bool tag, const string& what, bool end) #else if (tag) { - ++(*m_tag); - m_socket->send(*m_tag); m_socket->send(" "); } @@ -661,6 +657,9 @@ void IMAPConnection::send(bool tag, const string& what, bool end) m_socket->send("\r\n"); } #endif + + if (tag) + ++(*m_tag); } diff --git a/src/net/imap/IMAPTag.cpp b/src/net/imap/IMAPTag.cpp index 6754a15d..14d12788 100644 --- a/src/net/imap/IMAPTag.cpp +++ b/src/net/imap/IMAPTag.cpp @@ -42,6 +42,7 @@ IMAPTag::IMAPTag(const int number) : m_number(number) { m_tag.resize(4); + generate(); } @@ -49,13 +50,15 @@ IMAPTag::IMAPTag(const IMAPTag& tag) : object(), m_number(tag.m_number) { m_tag.resize(4); + generate(); } IMAPTag::IMAPTag() - : m_number(0) + : m_number(1) { m_tag.resize(4); + generate(); } @@ -80,6 +83,12 @@ const IMAPTag IMAPTag::operator++(int) } +int IMAPTag::maximumNumber() const +{ + return sm_maxNumber - 1; +} + + int IMAPTag::number() const { return (m_number); |