Mercurial > hg > orthanc
comparison UnitTests/main.cpp @ 100:27dc762e3dc8
getting rid of static dcmtk for debian
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 03 Oct 2012 09:33:25 +0200 |
parents | 8517e2c44283 |
children | 428784e59dcd |
comparison
equal
deleted
inserted
replaced
99:52ed88d3096a | 100:27dc762e3dc8 |
---|---|
277 { | 277 { |
278 printf("[%s]\n", Toolbox::GetPathToExecutable().c_str()); | 278 printf("[%s]\n", Toolbox::GetPathToExecutable().c_str()); |
279 printf("[%s]\n", Toolbox::GetDirectoryOfExecutable().c_str()); | 279 printf("[%s]\n", Toolbox::GetDirectoryOfExecutable().c_str()); |
280 } | 280 } |
281 | 281 |
282 | |
283 | |
284 #if DCMTK_BUNDLES_LOG4CPLUS == 0 | |
285 #include <log4cplus/logger.h> | |
286 #include <log4cplus/consoleappender.h> | |
287 #include <log4cplus/fileappender.h> | |
288 #include <log4cplus/configurator.h> | |
289 #else | |
290 #include <dcmtk/oflog/logger.h> | |
291 #include <dcmtk/oflog/consap.h> | |
292 #include <dcmtk/oflog/fileap.h> | |
293 //#include <dcmtk/oflog/configurator.h> | |
294 #endif | |
295 | |
296 | |
297 static log4cplus::Logger logger(log4cplus::Logger::getInstance("UnitTests")); | |
298 | |
299 TEST(Logger, Basic) | |
300 { | |
301 LOG4CPLUS_INFO(logger, "I say hello"); | |
302 } | |
303 | |
304 | |
282 int main(int argc, char **argv) | 305 int main(int argc, char **argv) |
283 { | 306 { |
307 using namespace log4cplus; | |
308 SharedAppenderPtr myAppender(new ConsoleAppender()); | |
309 //SharedAppenderPtr myAppender(new FileAppender("UnitTests.log")); | |
310 #if DCMTK_BUNDLES_LOG4CPLUS == 0 | |
311 std::auto_ptr<Layout> myLayout(new TTCCLayout()); | |
312 #else | |
313 OFauto_ptr<Layout> myLayout(new TTCCLayout()); | |
314 #endif | |
315 myAppender->setLayout(myLayout); | |
316 Logger::getRoot().addAppender(myAppender); | |
317 Logger::getRoot().setLogLevel(INFO_LOG_LEVEL); | |
318 | |
284 OrthancInitialize(); | 319 OrthancInitialize(); |
285 ::testing::InitGoogleTest(&argc, argv); | 320 ::testing::InitGoogleTest(&argc, argv); |
286 int result = RUN_ALL_TESTS(); | 321 int result = RUN_ALL_TESTS(); |
287 OrthancFinalize(); | 322 OrthancFinalize(); |
288 return result; | 323 return result; |