Browse Source

- init

master
parent
commit
a42d74de35
1 changed files with 29 additions and 0 deletions
  1. +29
    -0
      test/test_payload.cpp

+ 29
- 0
test/test_payload.cpp View File

@ -0,0 +1,29 @@
#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"));};

Loading…
Cancel
Save