rvm 1.08

test-rconfig-056.cc

Go to the documentation of this file.
00001 #include "config.h"
00002 
00003 #include <iostream>
00004 #include <string>
00005 #include <cassert>
00006 
00007 #include "asserts.h"
00008 #include "types.h"
00009 #include "error.h"
00010 #include "estring.h"
00011 #include "fs.h"
00012 #include "tstamp.h"
00013 #include "rconfig.h"
00014 
00015 // #define ERR_OUT(e) std::cerr << e;
00016 #define ERR_OUT(e)
00017 
00018 void test_cast(const rsync_behavior::value_type b_in)
00019 {
00020         estring s;
00021         uint64 i;
00022         rsync_behavior::value_type b_out;
00023 
00024         s = estring(static_cast<uint64>(b_in));
00025         i = static_cast<uint64>(s);
00026         b_out = static_cast<rsync_behavior::value_type>(i);
00027 
00028         assert(b_in == b_out);
00029 }
00030 
00031 void test(void)
00032 {
00033         test_cast(rsync_behavior::quit);
00034         test_cast(rsync_behavior::fail);
00035         test_cast(rsync_behavior::retry);
00036         test_cast(rsync_behavior::retry_without_hardlinks);
00037         test_cast(rsync_behavior::ok);
00038 }
00039 
00040 int main(int argc, char const * argv[])
00041 {
00042         try {
00043                 test();
00044         }
00045         catch(error e) {
00046                 std::cerr << e;
00047                 assert(0);
00048         }
00049         catch(...) {
00050                 std::cerr << err_unknown;
00051                 assert(0);
00052         }
00053         return(0);
00054 }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines