diff options
author | Sergey Yershov <yershov@corp.mail.ru> | 2015-08-11 20:02:56 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:00:54 +0300 |
commit | 8909791df194f8cb596ef617139ee57c0179e3da (patch) | |
tree | 9efdef1fcd109a111b1f0366b7648f00c6f69412 /generator | |
parent | 4d6d9837ea791f947b9dd5e0cf03dea0adfd94a4 (diff) |
Fix tests and asserts
Diffstat (limited to 'generator')
-rw-r--r-- | generator/osm_source.cpp | 5 | ||||
-rw-r--r-- | generator/xml_element.cpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/generator/osm_source.cpp b/generator/osm_source.cpp index b56dad0cdb..5c9ff74260 100644 --- a/generator/osm_source.cpp +++ b/generator/osm_source.cpp @@ -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)); } diff --git a/generator/xml_element.cpp b/generator/xml_element.cpp index 70b5ca9b7d..07972865c0 100644 --- a/generator/xml_element.cpp +++ b/generator/xml_element.cpp @@ -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())); |