Author: dmacvicar Date: Wed Jun 20 00:01:55 2007 New Revision: 5801 URL: http://svn.opensuse.org/viewcvs/zypp?rev=5801&view=rev Log: - unsucessfully tried to fix bug on ini parsing... Modified: trunk/libzypp/tests/parser/inifile/inidict_test.cc trunk/libzypp/tests/parser/inifile/iniparser_test.cc trunk/libzypp/zypp/RepoInfo.cc Modified: trunk/libzypp/tests/parser/inifile/inidict_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/inifile/inidict_test.cc?rev=5801&r1=5800&r2=5801&view=diff ============================================================================== --- trunk/libzypp/tests/parser/inifile/inidict_test.cc (original) +++ trunk/libzypp/tests/parser/inifile/inidict_test.cc Wed Jun 20 00:01:55 2007 @@ -16,6 +16,7 @@ using std::cout; using std::endl; using std::string; +using std::map; using namespace zypp; using namespace zypp::parser; using namespace boost::unit_test; @@ -39,6 +40,16 @@ } } +void ini_read_test2(const string &dir) +{ + InputStream is((Pathname(dir)+"/2.ini")); + IniDict dict(is); + + BOOST_CHECK( find( dict.sectionsBegin(), dict.sectionsEnd(), "base" ) != dict.sectionsEnd() ); + //IniDict::entry_const_iterator i = find( dict.entriesBegin("base"), dict.entriesEnd("base"), "name"); + //BOOST_CHECK( i != dict.entriesEnd("base") ); +} + test_suite* init_unit_test_suite( int argc, char *argv[] ) { @@ -61,6 +72,8 @@ std::string const params[] = { datadir }; test->add(BOOST_PARAM_TEST_CASE(&ini_read_test, (std::string const*)params, params+1)); + test->add(BOOST_PARAM_TEST_CASE(&ini_read_test2, + (std::string const*)params, params+1)); return test; } Modified: trunk/libzypp/tests/parser/inifile/iniparser_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/inifile/iniparser_test.cc?rev=5801&r1=5800&r2=5801&view=diff ============================================================================== --- trunk/libzypp/tests/parser/inifile/iniparser_test.cc (original) +++ trunk/libzypp/tests/parser/inifile/iniparser_test.cc Wed Jun 20 00:01:55 2007 @@ -29,7 +29,26 @@ virtual void consume( const std::string §ion, const std::string &key, const std::string &value ) { - MIL << section << " | " << key << " | " << value << endl; + MIL << "'" << section << "'" << " | " << "'" << key << "'" << " | " << "'" << value << "'" << endl; + } +}; + + +class WithSpacesTest : public IniParser +{ + virtual void consume( const std::string §ion ) + { + MIL << section << endl; + } + + virtual void consume( const std::string §ion, const std::string &key, const std::string &value ) + { + MIL << "'" << section << "'" << " | " << "'" << key << "'" << " | " << "'" << value << "'" << endl; + if ( section == "base") + { + if ( key == "name" ) + BOOST_CHECK_EQUAL( value, "foo" ); + } } }; @@ -40,6 +59,13 @@ parser.parse(is); } +void ini_spaces_test(const string &dir) +{ + InputStream is((Pathname(dir)+"/2.ini")); + WithSpacesTest parser; + parser.parse(is); +} + test_suite* init_unit_test_suite( int argc, char *argv[] ) { @@ -62,6 +88,8 @@ std::string const params[] = { datadir }; test->add(BOOST_PARAM_TEST_CASE(&ini_read_test, (std::string const*)params, params+1)); + test->add(BOOST_PARAM_TEST_CASE(&ini_spaces_test, + (std::string const*)params, params+1)); return test; } Modified: trunk/libzypp/zypp/RepoInfo.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoInfo.cc?rev=5801&r1=5800&r2=5801&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoInfo.cc (original) +++ trunk/libzypp/zypp/RepoInfo.cc Wed Jun 20 00:01:55 2007 @@ -191,19 +191,19 @@ std::ostream & RepoInfo::dumpRepoOn( std::ostream & str ) const { str << "[" << alias() << "]" << endl; - str << "name = " << name() << endl; + str << "name=" << name() << endl; if ( ! baseUrls().empty() ) - str << "baseurl = "; + str << "baseurl="; for ( urls_const_iterator it = baseUrlsBegin(); it != baseUrlsEnd(); ++it ) { str << *it << endl; } - str << "mirrorlist = " << mirrorListUrl() << endl; - str << "type = " << type().asString() << endl; - str << "enabled = " << (enabled() ? "1" : "0") << endl; + str << "mirrorlist=" << mirrorListUrl() << endl; + str << "type=" << type().asString() << endl; + str << "enabled=" << (enabled() ? "1" : "0") << endl; return str; } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org