remove default image in the example and rewrite usage

pull/56/head
Alexandra Latysheva 2020-10-30 12:36:42 +00:00
parent 2e2e0c741e
commit bfbb4f70c4
2 changed files with 6 additions and 13 deletions

View File

@ -16,8 +16,6 @@ add_executable(sandboxed
main_sandboxed.cc
../sandboxed.h
../test/data.h
../test/helper.h
../test/helper.cc
)
target_link_libraries(sandboxed PRIVATE

View File

@ -14,9 +14,8 @@
#include <cstdlib>
#include "../sandboxed.h" // NOLINT(build/include)
#include "../test/data.h" // NOLINT(build/include)
#include "../test/helper.h" // NOLINT(build/include)
#include "../sandboxed.h" // NOLINT(build/include)
#include "../test/data.h" // NOLINT(build/include)
#include "absl/algorithm/container.h"
#include "absl/strings/str_join.h"
#include "sandboxed_api/sandbox2/util/fileops.h"
@ -250,16 +249,12 @@ absl::Status LibTIFFMain(const std::string& srcfile) {
int main(int argc, char** argv) {
gflags::ParseCommandLineFlags(&argc, &argv, true);
std::string srcfile;
std::string srcfilerel = "quad-tile.jpg.tiff";
if (argc < 2) {
srcfile = GetFilePath(srcfilerel);
} else {
srcfile = GetFilePath(argv[1], srcfilerel);
if (argc != 2) {
LOG(ERROR) << "usage: sandboxed input";
return EXIT_FAILURE;
}
absl::Status status = LibTIFFMain(srcfile);
absl::Status status = LibTIFFMain(argv[1]);
if (!status.ok()) {
LOG(ERROR) << "LibTIFFMain failed with error:\n"
<< status.ToString() << '\n';