#include <util/pid_file.h>
#include <gtest/gtest.h>
+#include <fstream>
#include <signal.h>
+#include <stdint.h>
namespace {
using namespace isc::util;
pid_file.write(10);
// Read the file and compare the pid
- fs.open(absolutePath(TESTNAME), std::ifstream::in);
+ fs.open(absolutePath(TESTNAME).c_str(), std::ifstream::in);
fs >> pid;
EXPECT_TRUE(fs.good());
EXPECT_EQ(pid, 10);
pid_file.write(20);
// And comapre the second pid
- fs.open(absolutePath(TESTNAME), std::ifstream::in);
+ fs.open(absolutePath(TESTNAME).c_str(), std::ifstream::in);
fs >> pid;
EXPECT_TRUE(fs.good());
EXPECT_EQ(pid, 20);
pid_file.deleteFile();
// And verify that it's gone
- fs.open(absolutePath(TESTNAME), std::ifstream::in);
+ fs.open(absolutePath(TESTNAME).c_str(), std::ifstream::in);
EXPECT_FALSE(fs.good());
fs.close();
}
std::ofstream fs;
// Open the file and write garbage to it
- fs.open(absolutePath(TESTNAME), std::ofstream::out);
+ fs.open(absolutePath(TESTNAME).c_str(), std::ofstream::out);
fs << "text" << std::endl;
fs.close();