Browse Source

- get_relative_paths() should be relative to bagit base dir, needs further work

master
Andreas Romeyke 3 years ago
parent
commit
ea2c644e78
2 changed files with 5 additions and 4 deletions
  1. +1
    -0
      src/lib/payload.cpp
  2. +4
    -4
      test/test_payload.cpp

+ 1
- 0
src/lib/payload.cpp View File

@ -25,6 +25,7 @@ void Payload::scan_dir_recursively( fs::path directory, list<fs::path> &paths) {
}
}
// get all relative paths relative to the bag base directory
list<string> Payload::get_all_relative_paths() {
list<fs::path> paths;
list<string> strpaths;


+ 4
- 4
test/test_payload.cpp View File

@ -27,10 +27,10 @@ bool check_relative_paths() {
Payload p( "../testbags/bag_minimal_ok/" );
list<string> results = p.get_all_relative_paths();
list<string> expected {
"../testbags/bag_minimal_ok/data/1.txt",
"../testbags/bag_minimal_ok/data/3.dat",
"../testbags/bag_minimal_ok/data/subdir/2.dat",
"../testbags/bag_minimal_ok/data/subdir/2.md5",
"data/1.txt",
"data/3.dat",
"data/subdir/2.dat",
"data/subdir/2.md5",
};
results.sort();
expected.sort();


Loading…
Cancel
Save