Browse Source

- added debug()

master
Andreas Romeyke 2 years ago
parent
commit
1a637de73e
1 changed files with 15 additions and 1 deletions
  1. +15
    -1
      test/test_bagmetadata.cpp

+ 15
- 1
test/test_bagmetadata.cpp View File

@@ -3,12 +3,22 @@
#include <iostream>
#include <string>
#include <utility>

#include <boost/filesystem.hpp>
namespace fs = boost::filesystem;
#include "bagmetadata.hpp"
#include "checksum.hpp"

using namespace std;

void debug( Bagmetadata * p) {
stringstream log;
p->get_logstream( log );
cout << "##############################################" << endl;
cout << "DEBUG Bagmetadata" << endl;
cout << log.str() << endl;
cout << "##############################################" << endl;
}

bool check_constructor(string dir) {
try {
Bagmetadata p( std::move(dir) );
@@ -70,7 +80,11 @@ oxum_t check_get_PayloadOxum(string dir) {

bool check_store( string dir_load_from, string dir_store_to ) {
Bagmetadata p( std::move(dir_load_from) );
fs::path f{ dir_store_to };
fs::create_directory(f);
bool result = p.store( std::move(dir_store_to) );
fs::remove_all( f );
debug( &p );
return result;
}



Loading…
Cancel
Save