10 #pragma comment(lib, "Ws2_32.lib") 19 #define PATHDELIMITER "/" 21 #define PATHDELIMITER "\\" 31 int res =
remove(filename);
33 if (res != 0 && errno != ENOENT)
34 cout <<
"Can't remove file '" << filename <<
"'.\n";
36 return res == 0 || (res != 0 && errno == ENOENT);
77 FILE* f = fopen(filename,
"r");
80 cout <<
"File '" << filename <<
"' doesn't exists.\n";
100 if (!dailyTest.
setup())
102 cout <<
"Setup has failed. Check for permissions on files " <<
daily_file_prefix <<
"*'.\n";
119 const char* srcdir = getenv(
"srcdir");
120 std::string initFileName;
123 initFileName =
"./testConfig.log4cpp.dailyroll.nt.properties";
125 initFileName =
"./testConfig.log4cpp.dailyroll.properties";
127 if (srcdir != NULL) {
128 initFileName = std::string(srcdir) +
PATHDELIMITER + initFileName;
133 std::cout <<
"Configure Problem " << f.what() <<
"($srcdir=" << ((srcdir != NULL)?srcdir:
"NULL") <<
")" << std::endl;
142 root.
error(
"root error");
143 root.
warn(
"root warn");
144 sub1.
error(
"sub1 error");
145 sub1.
warn(
"sub1 warn");
int testConfigDailyRollingFileAppender()
CategoryStream debugStream()
DailyRollingFileAppender * nestedDirDailyApp
void warn(const char *stringFormat,...)
bool exists(const char *filename)
static Category & getInstance(const std::string &name)
int testOnlyDailyRollingFileAppender()
bool exists(const char *filename)
static Category & getRoot()
static const char *const daily_file_prefix
static const char *const nestedDir
const char *const nesteddirname
bool remove_impl(const char *filename)
virtual void setPriority(Priority::Value priority)
virtual void addAppender(Appender *appender)
void error(const char *stringFormat,...)
static const char *const test_message
static void configure(const std::string &initFileName)