@@ -107,6 +107,7 @@ split(const std::string &s, char delim)
107107std::map<std::string, std::tuple<std::string, std::string>> queries =
108108{
109109 { " dictionary.type" , std::make_tuple (" _:dictionary" , " <http://purl.org/dc/terms/format>" )},
110+ { " dict.block.size" , std::make_tuple (" _:dictionary" , " <http://purl.org/HDT/hdt#dictionaryblockSize>" )},
110111 { " triples.type" , std::make_tuple (" _:triples" , " <http://purl.org/dc/terms/format>" )},
111112 { " triplesOrder" , std::make_tuple (" _:triples" , " <http://purl.org/HDT/hdt#triplesOrder>" )}
112113};
191192main (int argc, char ** argv)
192193{
193194 // Given these configuration files
194- std::vector<std::string> elem = {" ../presets/dictionaryfour.hdtcfg" , " ../presets/dictionaryliteral.hdtcfg" , " ../presets/ops.hdtcfg" };
195+ std::vector<std::string> elem = {
196+ " ../presets/dictionaryfour.hdtcfg" ,
197+ " ../presets/dictionaryliteral.hdtcfg" ,
198+ " ../presets/ops.hdtcfg" };
195199 std::string nt_file_path = " ../data/test.nt" ;
196200 std::string hdt_file_path = " ./test.hdt" ;
197201 int err_creations = 0 ;
@@ -214,5 +218,22 @@ main(int argc, char** argv)
214218 // If some error, fail test
215219 if ( err_creations > 0 || err_readings > 0 || err_checking > 0 )
216220 return 1 ;
221+
222+ // For wrong files, make sure creation fails
223+ std::vector<std::string> wrong_files = {
224+ " ../presets/wrong_dictionaryfour.hdtcfg"
225+ };
226+ err_creations = 0 ;
227+ for (std::vector<std::string>::const_iterator iter = wrong_files.begin ();
228+ iter != wrong_files.end ();
229+ ++iter)
230+ {
231+ err_creations += create_hdt_file (nt_file_path, *iter, hdt_file_path);
232+ }
233+ std::cout << " Expected fails: " << wrong_files.size ()
234+ << " , Actual fails: " << err_creations << std::endl;
235+ // If expected fails not equal to actual fails, then fail test
236+ if ( err_creations != wrong_files.size () )
237+ return 1 ;
217238 return 0 ;
218239}
0 commit comments