fixed some non-explicit conversions, so that make distcheck runs on mac yosemite

This commit is contained in:
Marc Wäckerlin
2015-05-25 08:03:36 +00:00
parent 72ff6afad7
commit e12d8fb906
6 changed files with 20 additions and 11 deletions

View File

@@ -51,14 +51,14 @@ public:
CPPUNIT_ASSERT_EQUAL(-1, (mrw::AutoFile::Type)a); // init as -1
i = a = open((std::string(mrw::ifelse(getenv("srcdir"), "."))
+"/test.dat").c_str(), O_RDONLY);
CPPUNIT_ASSERT(i==a && a>0); // file is now open
CPPUNIT_ASSERT(i==(int)a && (int)a>0); // file is now open
mrw::AutoFile b(a);
CPPUNIT_ASSERT(a==-1 && i==b); // b has taken ownership
CPPUNIT_ASSERT((int)a==-1 && i==(int)b); // b has taken ownership
CPPUNIT_ASSERT(read(b, &c, 1)==1 && c=='H'); // file is good
mrw::AutoFile cc(i);
CPPUNIT_ASSERT(i==b && b==cc); // ooops, two owner!
CPPUNIT_ASSERT(i==(int)b && (int)b==(int)cc); // ooops, two owner!
cc.release();
CPPUNIT_ASSERT(i==b && cc==-1); // it's ok now
CPPUNIT_ASSERT(i==(int)b && (int)cc==-1); // it's ok now
b = open("test.dat", O_RDONLY);
//close(i);
CPPUNIT_ASSERT_EQUAL((ssize_t)-1, read(i, &c, 1)); // old file is closed