Fixed pointer in flogger-test

This commit is contained in:
Markus Gans 2020-05-25 00:30:51 +02:00
parent 59830cbd05
commit 8a153c6d45
3 changed files with 58 additions and 5 deletions

46
confdefs.h Normal file
View File

@ -0,0 +1,46 @@
/* confdefs.h */
#define PACKAGE_NAME "finalcut"
#define PACKAGE_TARNAME "finalcut"
#define PACKAGE_VERSION "0.6.1"
#define PACKAGE_STRING "finalcut 0.6.1"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define __EXTENSIONS__ 1
#define _ALL_SOURCE 1
#define _GNU_SOURCE 1
#define _POSIX_PTHREAD_SEMANTICS 1
#define _TANDEM_SOURCE 1
#define PACKAGE "finalcut"
#define VERSION "0.6.1"
#define STDC_HEADERS 1
#define HAVE_LINUX_FB_H 1
#define HAVE_SYS_IO_H 1
#define HAVE_SYS_KD_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_FCNTL_H 1
#define HAVE_LANGINFO_H 1
#define HAVE_TERM_H 1
#define HAVE_TERMIOS_H 1
#define HAVE_TTYENT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_GETUID 1
#define HAVE_GETEUID 1
#define HAVE_GETTTYNAM 1
#define HAVE_SELECT 1
#define HAVE_STRDUP 1
#define HAVE_STRSTR 1
#define HAVE_VSNPRINTF 1
#define HAVE_DLFCN_H 1
#define LT_OBJDIR ".libs/"
#define HAVE_LIBGPM 1

View File

@ -13,10 +13,10 @@ Table of Contents
- [Event handler reimplementation](#event-handler-reimplementation) - [Event handler reimplementation](#event-handler-reimplementation)
- [Signals and Callbacks](#signals-and-callbacks) - [Signals and Callbacks](#signals-and-callbacks)
- [Default signals](#the-final-cut-widgets-emit-the-following-default-signals) - [Default signals](#the-final-cut-widgets-emit-the-following-default-signals)
- [Callback function](#example-of-a-callback-function) - [Callback function](#example-of-a-callback-function)
- [Callback lambda expression](#example-of-an-lambda-expression-callback) - [Callback lambda expression](#example-of-an-lambda-expression-callback)
- [Callback method](#example-of-a-callback-function) - [Callback method](#example-of-a-callback-function)
- [Custom signals](#send-custom-signals) - [Custom signals](#send-custom-signals)
- [Widget layout](#widget-layout) - [Widget layout](#widget-layout)
- [Coordinates](#coordinates) - [Coordinates](#coordinates)
- [Lengths](#lengths) - [Lengths](#lengths)
@ -616,7 +616,7 @@ class dialogWidget : public FDialog
{ {
public: public:
explicit dialogWidget (FWidget* parent = nullptr) explicit dialogWidget (FWidget* parent = nullptr)
: FDialog(parent) : FDialog{parent}
{ {
setText ("Callback method"); setText ("Callback method");
setGeometry (FPoint{25, 5}, FSize{25, 7}); setGeometry (FPoint{25, 5}, FSize{25, 7});

View File

@ -303,7 +303,11 @@ void FLoggerTest::fileTest()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FLoggerTest::applicationObjectTest() void FLoggerTest::applicationObjectTest()
{ {
// Generation of a logger in a shared_ptr via a pointer
finalcut::FApplication::setLog (std::make_shared<finalcut::FLogger>());
// Get the shared_ptr with the base class
std::shared_ptr<finalcut::FLog> log = finalcut::FApplication::getLog(); std::shared_ptr<finalcut::FLog> log = finalcut::FApplication::getLog();
std::ostringstream buf{}; std::ostringstream buf{};
log->setOutputStream(buf); log->setOutputStream(buf);
@ -351,6 +355,9 @@ void FLoggerTest::applicationObjectTest()
log->debug("myLogger 4"); log->debug("myLogger 4");
CPPUNIT_ASSERT ( buf.str() == "Debug: myLogger 4\n" ); CPPUNIT_ASSERT ( buf.str() == "Debug: myLogger 4\n" );
buf.str(""); // Clear buffer buf.str(""); // Clear buffer
std::shared_ptr<finalcut::FLog>* logger = &(finalcut::FApplication::getLog());
delete logger;
} }