Skip to content

Commit eb0c35c

Browse files
committed
tests: add MessageDatabase tests (getMessage() + importFromFile())
1 parent e185df4 commit eb0c35c

File tree

2 files changed

+617
-2
lines changed

2 files changed

+617
-2
lines changed

code/MessageDatabase.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ bool MessageDatabase::processFolderNode(const XMLNode& node, uint32_t& readPMs,
162162

163163
if (current.getNameAsString() != "privatemessage")
164164
{
165-
std::cerr << "Current node should habe name \"privatemessage\", but it is \""
165+
std::cerr << "Current node should have name \"privatemessage\", but it is \""
166166
<< current.getNameAsString() << "\" instead!\n";
167167
return false;
168168
}
@@ -234,7 +234,8 @@ bool MessageDatabase::processPrivateMessageNode(const XMLNode& node, uint32_t& r
234234

235235
const std::string temp = current.getPlainTextContent();
236236
uint32_t tempUint;
237-
if (!(std::stringstream (temp) >> tempUint))
237+
if (!(std::stringstream (temp) >> tempUint)
238+
|| (std::to_string(tempUint) != temp))
238239
{
239240
std::cerr << "Error: Could not convert \"" << temp << "\" to integer!\n";
240241
return false;

0 commit comments

Comments
 (0)