rvm 1.08

test-vaulter-002.cc

Go to the documentation of this file.
00001 #include "config.h"
00002 
00003 #include <iostream>
00004 #include <fstream>
00005 #include <iomanip>
00006 #include <string>
00007 #include <cassert>
00008 
00009 #include "error.h"
00010 #include "fs.h"
00011 #include "vaulter.h"
00012 #include "test-vaulter-setup.h"
00013 
00014 // #define ERR_OUT(e) std::cerr << e
00015 #define ERR_OUT(e)
00016 
00017 void test_vaulter(void)
00018 {
00019         char const * argv[256] = { 0 };
00020         int argc = 0;
00021         bool thrown = false;
00022 
00023         argv[argc++] = "<program>";
00024         argv[argc++] = "--archive";
00025 
00026         config.default_file("./test-vaulter.dir/file-1.conf");
00027         try {
00028                 config.init(argc, argv);
00029                 logger.init();
00030                 vaulter.init();
00031                 logger.clear();
00032         }
00033         catch(error e) {
00034                 ERR_OUT(e);
00035                 thrown = true;
00036         }
00037         catch(...) {
00038                 ERR_OUT(err_unknown);
00039                 assert(0);
00040         }
00041         assert(!thrown);
00042 }
00043 
00044 int main(int argc, char const * argv[])
00045 {
00046         cleanup();
00047         setup();
00048         try {
00049                 test_vaulter();
00050         }
00051         catch(error e) {
00052                 std::cerr << e;
00053                 assert(0);
00054         }
00055         catch(...) {
00056                 std::cerr << err_unknown;
00057                 assert(0);
00058         }
00059         cleanup();
00060         return(0);
00061 }
00062 
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines