Changeset 1152 for trunk/test/config_test.cc
- Timestamp:
- Aug 7, 2010, 4:31:18 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/config_test.cc
r1119 r1152 29 29 void test_codon(test::Suite&); 30 30 void test_read_write(test::Suite&); 31 void test_props(test::Suite&); 31 32 }} // end of namespace svndigest and theplu 32 33 … … 39 40 test_codon(suite); 40 41 test_read_write(suite); 42 test_props(suite); 41 43 42 44 if (suite.ok()) { … … 54 56 void test_codon(test::Suite& suite) 55 57 { 58 suite.out() << "test codons" << std::endl; 56 59 const Configuration& c(Configuration::instance()); 57 60 if (!c.codon("foo.h")){ … … 69 72 } 70 73 74 void test_props(test::Suite& suite) 75 { 76 suite.out() << "test props" << std::endl; 77 Configuration& conf(Configuration::instance()); 78 std::stringstream ss; 79 ss << "[svn_props]\n" 80 << "foo* = svndigest:ignore\n" 81 << "bar* = svn:eol-style=native;svncopyright:ignore\n"; 82 conf.load(ss); 83 const std::map<std::string, std::string>& props = 84 conf.svn_properties("foo_bla_bla"); 85 if (props.find("svndigest:ignore")==props.end()) { 86 suite.out() << "property svndigest:ignore not set for foo_bla_bla\n"; 87 suite.add(false); 88 } 89 const std::map<std::string, std::string>& props2 = 90 conf.svn_properties("bar_bla_bla"); 91 std::map<std::string, std::string>::const_iterator it = 92 props2.find("svn:eol-style"); 93 if (!suite.add(it != props2.end())) 94 suite.out() <<"expected property 'svn:eol-style' set for bar_bla_bla\n"; 95 else if (!suite.add(it->second == "native")) 96 suite.out() << "expected 'svn:eol-style' set to 'native' " 97 << "for bar_bla_bla\n"; 98 // checking that we return empty map for files not mentioned in config 99 suite.out() << "props3" << std::endl; 100 const std::map<std::string, std::string>& props3 = 101 conf.svn_properties("nothing-nothing"); 102 suite.add(props3.empty()); 103 } 104 71 105 void test_read_write(test::Suite& suite) 72 106 {
Note: See TracChangeset
for help on using the changeset viewer.