C++ Library to handle BagIt structures. BagIt is a standard format to create transfer packages for digital preservation purposes. See https://en.wikipedia.org/wiki/BagIt for details http://andreas-romeyke.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
831 B

#define BOOST_TEST_MODULE TestPayload
#include <boost/test/unit_test.hpp>
namespace utf = boost::unit_test;
#include "payload.hpp"
#include <string>
using namespace std;
bool check_constructor(string dir) {
try {
Payload p( dir );
return true;
} catch (exception &e) {
return false;
bool check_dir(string dir) {
list<string> log;
Payload p( dir );
return p.validate( log);
BOOST_AUTO_TEST_CASE(constructor1) {BOOST_TEST(check_constructor(""));};
BOOST_AUTO_TEST_CASE(constructor2) {BOOST_TEST(check_constructor("./"));};
BOOST_AUTO_TEST_CASE(constructor3) {BOOST_TEST(check_constructor("/tmp/"));};
BOOST_AUTO_TEST_CASE(check_dir_ok) {BOOST_TEST(check_dir("../testbags/bag_minimal_ok/data"));};
BOOST_AUTO_TEST_CASE(check_dir_buggy) {BOOST_TEST(check_dir("../testbags/1008_buggy/data"));};