Ver a proveniência

- added tests using the new test bagits

master
Andreas Romeyke há 10 meses
ascendente
cometimento
b7cde83c0d
1 ficheiros alterados com 81 adições e 1 eliminações
  1. +81
    -1
      test/testbag.cpp

+ 81
- 1
test/testbag.cpp Ver ficheiro

@@ -93,7 +93,87 @@ BOOST_AUTO_TEST_CASE(check_get_all_bag_files_ok_old) {
BOOST_TEST(check_get_all_bag_files("../testbags/bag_minimal_v0.97"));
};

void test_valid_bagit_dirs () {
list<string> valid_dirs {
"valid_md5",
"valid_md5_invalid_sha1_invalid_sha256_invalid_sha512",
"valid_md5_invalid_sha1_invalid_sha256_valid_sha512",
"valid_md5_invalid_sha1_valid_sha256_invalid_sha512",
"valid_md5_invalid_sha1_valid_sha256_valid_sha512",
"valid_md5_valid_sha1_invalid_sha256_invalid_sha512",
"valid_md5_valid_sha1_invalid_sha256_valid_sha512",
"valid_md5_valid_sha1_valid_sha256_invalid_sha512",
"valid_md5_valid_sha1_valid_sha256_valid_sha512",
"valid_multiple_valid_checksums",
"valid_sha1",
"valid_sha256",
"valid_sha512",
"valid_with_additional_meta_dir"
};
for (auto i=valid_dirs.begin(); i!=valid_dirs.end(); i++) {
BOOST_TEST(check_validation((*i)));
}
}

void test_invalid_bagit_dirs () {
list<string> invalid_dirs {
"invalid_data_file_in_tagmanifest",
"invalid_duplicate_bagcount",
"invalid_duplicate_bagging_date",
"invalid_duplicate_baggroup",
"invalid_duplicate_bagsize",
"invalid_duplicate_entries_in_manifest",
"invalid_duplicate_entries_in_tagmanifest",
"invalid_duplicate_payload_oxum",
"invalid_empty_manifest_but_entries_in_data",
"invalid_empty_tagmanifest",
"invalid_md5",
"invalid_md5_invalid_sha1_invalid_sha256_invalid_sha512",
"invalid_md5_invalid_sha1_invalid_sha256_valid_sha512",
"invalid_md5_invalid_sha1_valid_sha256_invalid_sha512",
"invalid_md5_invalid_sha1_valid_sha256_valid_sha512",
"invalid_md5_valid_sha1_invalid_sha256_invalid_sha512",
"invalid_md5_valid_sha1_invalid_sha256_valid_sha512",
"invalid_md5_valid_sha1_valid_sha256_invalid_sha512",
"invalid_md5_valid_sha1_valid_sha256_valid_sha512",
"invalid_missed_baginfo",
"invalid_missed_baginfo_in_tagmanifest",
"invalid_missed_bagit",
"invalid_missed_bagit_in_tagmanifest",
"invalid_missed_bagit_version",
"invalid_missed_data_dir",
"invalid_missed_data_subdir",
"invalid_missed_encoding",
"invalid_missed_manifest",
"invalid_missed_manifest_in_tagmanifest",
"invalid_missed_referenced_data_file",
"invalid_missed_referenced_file_in_subdir",
"invalid_missed_tagmanifest",
"invalid_payload_oxum",
"invalid_sha1",
"invalid_sha256",
"invalid_sha512",
"invalid_tagmanifest_files_with_different_entries",
"outdated_bagit_version",
"unreferenced_files_in_bag"
};

for (auto i=invalid_dirs.begin(); i!=invalid_dirs.end(); i++) {
BOOST_TEST(! check_validation((*i)));
}
}
BOOST_AUTO_TEST_CASE(check_valid_dirs) {
check_valid_dirs();
}
BOOST_AUTO_TEST_CASE(check_invalid_dirs) {
check_invalid_dirs();
}



BOOST_FIXTURE_TEST_CASE(check_store_ok, TARGETFIXTURE) {
BOOST_TEST(check_store("../testbags/bag_minimal_ok/", targetdir));
BOOST_TEST(check_store("../testbags/bag_minimal_ok/", targetdir));
};




Carregando…
Cancelar
Guardar