Fix tests and asserts

This commit is contained in:
Sergey Yershov 2015-08-11 20:02:56 +03:00 committed by Alex Zolotarev
parent 4d6d9837ea
commit 8909791df1
2 changed files with 4 additions and 3 deletions

View file

@ -29,9 +29,10 @@ SourceReader::SourceReader()
}
SourceReader::SourceReader(string const & filename)
: m_file(unique_ptr<istream, Deleter>(new ifstream(filename), Deleter()))
{
CHECK(!m_filename.empty() , ("Filename can't be empty"));
CHECK(!filename.empty() , ("Filename can't be empty"));
m_file = unique_ptr<istream, Deleter>(new ifstream(filename), Deleter());
CHECK(static_cast<ifstream *>(m_file.get())->is_open() , ("Can't open file:", filename));
LOG_SHORT(LINFO, ("Reading OSM data from", filename));
}

View file

@ -106,7 +106,7 @@ void BaseOSMParser::AddAttr(string const & key, string const & value)
bool BaseOSMParser::Push(string const & tagName)
{
ASSERT_GREATER(tagName.size(), 2, ());
ASSERT_GREATER_OR_EQUAL(tagName.size(), 2, ());
// As tagKey we use first two char of tag name.
XMLElement::ETag tagKey = XMLElement::ETag(*reinterpret_cast<uint16_t const *>(tagName.data()));