Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+52
@@ -0,0 +1,52 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
#
|
||||
|
||||
SET(LinkedSources
|
||||
# ../Utils/IdHandler.cpp
|
||||
# ../Utils/IdHandler.h
|
||||
|
||||
log4cxxSituationMapUnitTest.props
|
||||
)
|
||||
|
||||
SET(UnitTest_SRCS
|
||||
unit_test.cpp
|
||||
unit_test.h
|
||||
virtual_inheritances.cpp
|
||||
)
|
||||
|
||||
SOURCE_GROUP( LinkedSources FILES ${LinkedSources} )
|
||||
SOURCE_GROUP( UnitTestSources FILES ${UnitTest_SRCS} )
|
||||
|
||||
IF(BUILD_TESTING AND TARGET situationMap)
|
||||
ADD_EXECUTABLE(situationMapUnitTest ${LinkedSources} ${UnitTest_SRCS} )
|
||||
|
||||
TARGET_LINK_LIBRARIES(situationMapUnitTest
|
||||
ArcGISQt5Hack
|
||||
NGLLogger
|
||||
nglapplication
|
||||
advancedSymbology_static
|
||||
situationMap_static
|
||||
situationMapObjects
|
||||
ArcGIS::ArcGIS
|
||||
Qt5::Core
|
||||
Qt5::Test
|
||||
)
|
||||
ADD_TEST(NAME situationMapUnitTest_NONE COMMAND $<TARGET_FILE:situationMapUnitTest> none)
|
||||
ADD_TEST(NAME situationMapUnitTest_MIL2525D COMMAND $<TARGET_FILE:situationMapUnitTest> mil2525d)
|
||||
|
||||
SET(LOG4CXX_PROPS_FILE log4cxxSituationMapUnitTest.props)
|
||||
ADD_CUSTOM_COMMAND(TARGET situationMapUnitTest POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
ARGS -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${LOG4CXX_PROPS_FILE} $<TARGET_FILE_DIR:situationMapUnitTest>/${LOG4CXX_PROPS_FILE}
|
||||
)
|
||||
|
||||
IF(MSVC)
|
||||
# Configure the template file
|
||||
SET(VS_USER_FILE situationMapUnitTest.vcxproj.user)
|
||||
configure_file( ../SituationMap.vcxproj.user.in ${CMAKE_CURRENT_BINARY_DIR}/${VS_USER_FILE} @ONLY)
|
||||
ENDIF()
|
||||
|
||||
ENDIF()
|
||||
@@ -0,0 +1,167 @@
|
||||
log4j.reset=true
|
||||
log4j.rootLogger=WARN, file, stdout
|
||||
|
||||
# SitMap
|
||||
###########################################################
|
||||
#log4j.logger.SituationMap.SitMapUnitTest=DEBUG
|
||||
#log4j.logger.SituationMap.SitMap=WARN
|
||||
|
||||
# AdvancedSymbology (AdvSymbology)
|
||||
###########################################################
|
||||
#log4j.logger.AdvSymbology.SymbolDictionary=INFO
|
||||
#log4j.logger.AdvSymbology.SymbolDictionaryImpl=INFO
|
||||
#log4j.logger.AdvSymbology.EsriDictionaryProcessor=INFO
|
||||
#log4j.logger.AdvSymbology.SymbolResult=INFO
|
||||
#log4j.logger.AdvSymbology.Sidc2525Delta=INFO
|
||||
|
||||
# SituationMap
|
||||
###########################################################
|
||||
#log4j.logger.SituationMap.INFO
|
||||
|
||||
log4j.logger.SituationMap.LoggingTest=ERROR
|
||||
log4j.logger.SituationMap.LoggingTest.Chan1=INFO
|
||||
log4j.logger.SituationMap.LoggingTest.Chan2=ERROR
|
||||
|
||||
#log4j.logger.SituationMap.MapImpl=WARN
|
||||
#log4j.logger.SituationMap.MapSettings=WARN
|
||||
#log4j.logger.SituationMap.MapInitializer=WARN
|
||||
#log4j.logger.SituationMap.LayerFactoryImpl=WARN
|
||||
#log4j.logger.SituationMap.LayerControl=WARN
|
||||
#log4j.logger.SituationMap.CoordTranslationFunctorImpl=WARN
|
||||
#log4j.logger.SituationMap.CoordTranslationThread=WARN
|
||||
#log4j.logger.SituationMap.PositionsTranslated=WARN
|
||||
#log4j.logger.SituationMap.GridImpl=WARN
|
||||
#log4j.logger.SituationMap.ObjectFactory=WARN
|
||||
#log4j.logger.SituationMap.IdGenerator=TRACE
|
||||
#log4j.logger.SituationMap.ObjectContainer=TRACE
|
||||
#log4j.logger.SituationMap.ObjectContainerCTC=TRACE
|
||||
#log4j.logger.SituationMap.OverlayHandlerImpl=TRACE
|
||||
#log4j.logger.SituationMap.ViewshedImpl=INFO
|
||||
#log4j.logger.SituationMap.ViewshedBase=INFO
|
||||
|
||||
#log4j.logger.SituationMap.AbstractMapObjectImpl=INFO
|
||||
#log4j.logger.SituationMap.AbstractEffectSimulationImpl=INFO
|
||||
#log4j.logger.SituationMap.OriginTranslated=INFO
|
||||
#log4j.logger.SituationMap.PositionsTranslated=INFO
|
||||
#log4j.logger.SituationMap.AbstractMultiPointMapObjectImpl=INFO
|
||||
#log4j.logger.SituationMap.AbstractSinglePointMapObjectImpl=INFO
|
||||
#log4j.logger.SituationMap.BasicPathObjectImpl=INFO
|
||||
#log4j.logger.SituationMap.IndicationContainer=INFO
|
||||
|
||||
#log4j.logger.SituationMap.PolygonImpl=INFO
|
||||
#log4j.logger.SituationMap.PolylineImpl=INFO
|
||||
#log4j.logger.SituationMap.TextImpl=INFO
|
||||
|
||||
#log4j.logger.SituationMap.AreaFireImpl=INFO
|
||||
#log4j.logger.SituationMap.BiologicalAgentImpl=INFO
|
||||
#log4j.logger.SituationMap.BuildingOutlineImpl=INFO
|
||||
#log4j.logger.SituationMap.ChemicalAgentImpl=INFO
|
||||
#log4j.logger.SituationMap.DangerAreaImpl=INFO
|
||||
#log4j.logger.SituationMap.FunctionalAreaImpl=INFO
|
||||
#log4j.logger.SituationMap.HitLineImpl=INFO
|
||||
#log4j.logger.SituationMap.MapObjectIndicatorImpl=INFO
|
||||
#log4j.logger.SituationMap.MineImpl=INFO
|
||||
#log4j.logger.SituationMap.MineFieldImpl=INFO
|
||||
#log4j.logger.SituationMap.NuclearAgentImpl=INFO
|
||||
#log4j.logger.SituationMap.ParticipantImpl=INFO
|
||||
#log4j.logger.SituationMap.SingleFireImpl=INFO
|
||||
|
||||
#log4j.logger.SituationMap.AbstractGraphicalObject=INFO
|
||||
#log4j.logger.SituationMap.GraphicalObjectEllipse=INFO
|
||||
#log4j.logger.SituationMap.GraphicalObjectPath=INFO
|
||||
#log4j.logger.SituationMap.GraphicalObjectMultiPath=INFO
|
||||
#log4j.logger.SituationMap.GraphicalObjectPictureMarker=INFO
|
||||
#log4j.logger.SituationMap.GraphicalObjectRange=INFO
|
||||
#log4j.logger.SituationMap.GraphicalObjectText=INFO
|
||||
#log4j.logger.SituationMap.TacticalAppearance=INFO
|
||||
#log4j.logger.SituationMap.MessageBase=INFO
|
||||
|
||||
#log4j.logger.SituationMap.EventDispatcher=FATAL
|
||||
#log4j.logger.SituationMap.Rubberband=FATAL
|
||||
#log4j.logger.SituationMap.RubberbandRectangle=FATAL
|
||||
#log4j.logger.SituationMap.RubberbandDrawablesAndHandles=FATAL
|
||||
#log4j.logger.SituationMap.RubberbandFrameHandle=FATAL
|
||||
#log4j.logger.SituationMap.RubberbandPointHandle=FATAL
|
||||
#log4j.logger.SituationMap.RubberbandStateSelect=FATAL
|
||||
|
||||
# SituationMap-SideBar
|
||||
###########################################################
|
||||
#log4j.logger.SituationMap.SideBar=INFO
|
||||
#log4j.logger.SituationMap.SideBarItem=INFO
|
||||
#log4j.logger.SituationMap.SideBarModel=INFO
|
||||
|
||||
|
||||
|
||||
|
||||
# Appnd_File
|
||||
###########################################################
|
||||
log4j.appender.file=org.apache.log4j.RollingFileAppender
|
||||
log4j.appender.file.MaxFileSize=1MB
|
||||
log4j.appender.file.MaxBackupIndex=9
|
||||
log4j.appender.file.file=${LOG4QT_LOGDIR}/${LOG4QT_USER}_SituationMap.log
|
||||
log4j.appender.file.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.file.layout.ConversionPattern=%d %-5p %c |#| %m (%.50F:%L) %n
|
||||
|
||||
|
||||
# Appnd_Console
|
||||
###########################################################
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern= %d %-5p %c{1} |#| %m (%-.30F:%L) %n
|
||||
|
||||
#log4j.appender.stdout.layout.ConversionPattern= %d %-5p %-30c |#| %m (%-.30F:%L) %n
|
||||
|
||||
|
||||
# Appnd_Syslog
|
||||
###########################################################
|
||||
log4j.appender.syslog=org.apache.log4j.SyslogAppender
|
||||
log4j.appender.syslog.Threshold=ERROR
|
||||
log4j.appender.syslog.SysLogHost=localhost
|
||||
log4j.appender.syslog.Facility=LOCAL7
|
||||
log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.syslog.layout.ConversionPattern= %-4r %-5p %c %x - %m
|
||||
log4j.appender.syslog.LevelRangeFilter.AcceptOnMatch=true
|
||||
log4j.appender.syslog.LevelRangeFilter.LevelMin=INFO
|
||||
log4j.appender.syslog.LevelRangeFilter.LevelMax=FATAL
|
||||
|
||||
|
||||
###########################################################
|
||||
###########################################################
|
||||
###########################################################
|
||||
# 1) Available Levels in LOG4CXX Version 0.10.0:
|
||||
# TRACE,
|
||||
# DEBUG,
|
||||
# INFO,
|
||||
# WARN,
|
||||
# ERROR
|
||||
# FATAL
|
||||
#
|
||||
# d = date/time
|
||||
# p = priority (Level)
|
||||
# c = category/channel
|
||||
# m = message
|
||||
# F = file
|
||||
# L = line
|
||||
# n = platform dependent line separator character or characters.
|
||||
# ....
|
||||
#
|
||||
# Examples for console:
|
||||
# a)
|
||||
# %d %p %c #%m# (%.50F:%L)%n
|
||||
# date/time
|
||||
# priority
|
||||
# category/channel
|
||||
# #message#
|
||||
# (Maximal 50Character des Filename von rechts:Line)
|
||||
# line separator
|
||||
#
|
||||
# b)
|
||||
# %d (%.15F:%L) %-5p %c |#| %m%n
|
||||
# date/time
|
||||
# (Maximal 15Character des Filename von rechts:Line)
|
||||
# priority, Right pad with spaces if the priority name is less than 5 characters long.
|
||||
# category/channel
|
||||
# message
|
||||
# line separator
|
||||
#
|
||||
|
||||
+3643
File diff suppressed because it is too large.
Load diff
+142
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Unittest
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QtTest/QTest>
|
||||
#include <QDialog>
|
||||
|
||||
#include <Common/situation_map_logging.h>
|
||||
|
||||
namespace AdvancedSymbology
|
||||
{
|
||||
enum class SymbologyType;
|
||||
}
|
||||
|
||||
|
||||
class CheckSignal : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
bool isConnected(quint64 &msec);
|
||||
|
||||
signals:
|
||||
void mySignal();
|
||||
};
|
||||
|
||||
|
||||
|
||||
class SitMapUnitTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SitMapUnitTest(AdvancedSymbology::SymbologyType symbologyType);
|
||||
virtual ~SitMapUnitTest();
|
||||
|
||||
private:
|
||||
void checkSymbolDictionaryLoad();
|
||||
void checkSymbolDictionaryLoad(AdvancedSymbology::SymbologyType st);
|
||||
private Q_SLOTS:
|
||||
|
||||
void checkLogging();
|
||||
|
||||
void checkQRect();
|
||||
void checkQListQVector();
|
||||
void checkQWeakPointer();
|
||||
|
||||
void checkFactoryCreationContraints();
|
||||
|
||||
// void checkIdHandlerCreate();
|
||||
// void checkIdHandlerFree();
|
||||
// void checkIdHandlerReUseId();
|
||||
// void checkIdHandlerReserveId();
|
||||
|
||||
void checkSimpleValue();
|
||||
|
||||
void checkIdGenerator();
|
||||
void checkIdContainer();
|
||||
|
||||
void checkIsSignalConnected();
|
||||
void onCheckIsSignalConnected();
|
||||
|
||||
void checkMapLayer();
|
||||
void checkMapLayerOrderedList();
|
||||
|
||||
void checkLayerFactory();
|
||||
|
||||
void checkObjectFactory();
|
||||
|
||||
void checkPickableOnInvalidUniqueMapId();
|
||||
|
||||
void checkBoundingBox();
|
||||
|
||||
void checkDistanceMeasurement();
|
||||
void measureDistanceGeodetic();
|
||||
|
||||
void recalculateAngle();
|
||||
|
||||
void checkDensify();
|
||||
void checkBuffer();
|
||||
|
||||
void checkMovementTrack();
|
||||
void checkMovementTrackManager();
|
||||
|
||||
|
||||
void checkSidcCodec();
|
||||
|
||||
void checkSIDCDefinitions1();
|
||||
void checkSIDCDefinitions2();
|
||||
// void checkCreateSidc();
|
||||
// void checkSymbolProperties();
|
||||
void checkSymbolDictionaryLoadSymbolXml();
|
||||
|
||||
void checkSymbolDictionaryConsistency();
|
||||
|
||||
void checkSymbolDictionaryFetchSymbol();
|
||||
void checkSymbolDictionaryFetchSymbol2();
|
||||
void checkSymbolDictionaryFetchSymbolAll();
|
||||
void checkSymbolDictionaryExtraDirFetchSymbol();
|
||||
void checkSymbolDictionaryFetchSymbolStress();
|
||||
|
||||
void checkSymbolDictionaryBulkRenderer();
|
||||
|
||||
void checkSymbolDictionarySymbolPropertyImage();
|
||||
|
||||
void checkSymbolDictionaryFindImage();
|
||||
void checkSymbolDictionaryFindPreview();
|
||||
void checkSymbolDictionaryFindBaseSymbol();
|
||||
|
||||
void checkSymbolDictionaryGctString();
|
||||
|
||||
|
||||
void checkMapSettings();
|
||||
|
||||
void checkMatrix2D();
|
||||
|
||||
void virtualInheritances();
|
||||
|
||||
void multiInheritancesVisualStudio2015Bug();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
class Private;
|
||||
|
||||
static const unsigned int m_initReserve = 20;
|
||||
static const unsigned int m_blockSize = 10;
|
||||
|
||||
SituationMap::LOGGER_T m_logger;
|
||||
std::unique_ptr<Private> m_d;
|
||||
|
||||
};
|
||||
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Unittest
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "unit_test.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QtTest/QTest>
|
||||
#include <QtTest/QSignalSpy>
|
||||
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* Test of virtual inheritance combined with constuctor delegation. With gcc all works fine. With Visual Studio 2013 on Windows
|
||||
* the constructor of VirtualBaseInterface class is called twice. This may crash the program or result in other unexpected behaviour.
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
|
||||
|
||||
class VirtualBaseInterface
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
static unsigned int _ctorCount;
|
||||
|
||||
VirtualBaseInterface()
|
||||
{
|
||||
qDebug() << "ctor of class VirtualBaseInterface() has been called";
|
||||
_ctorCount++;
|
||||
}
|
||||
|
||||
VirtualBaseInterface(int, int)
|
||||
{
|
||||
// in case of virtual inheritance this ctor will never be used.
|
||||
qDebug() << "ctor of class VirtualBaseInterface(int x, int y) has been called";
|
||||
_ctorCount++;
|
||||
}
|
||||
|
||||
~VirtualBaseInterface() = default;
|
||||
|
||||
virtual void foo() = 0;
|
||||
};
|
||||
|
||||
unsigned int VirtualBaseInterface::_ctorCount = 0;
|
||||
|
||||
|
||||
class BaseClass : virtual public VirtualBaseInterface , public QObject
|
||||
{
|
||||
protected:
|
||||
|
||||
int c;
|
||||
|
||||
public:
|
||||
|
||||
BaseClass(int x, int y) : BaseClass(x, y, 10)
|
||||
{
|
||||
qDebug() << "ctor of class BaseClass(int x,int y) has been called";
|
||||
}
|
||||
|
||||
BaseClass(int x, int y, int z) : VirtualBaseInterface(), QObject(), c(z)
|
||||
{
|
||||
Q_UNUSED(x)
|
||||
Q_UNUSED(y)
|
||||
qDebug() << "ctor of class BaseClass(int x,int y,int z) has been called";
|
||||
}
|
||||
|
||||
virtual ~BaseClass() = default;
|
||||
|
||||
void foo() override
|
||||
{
|
||||
c = 10;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Derived1 : public BaseClass
|
||||
{
|
||||
protected:
|
||||
|
||||
int d;
|
||||
|
||||
public:
|
||||
|
||||
Derived1(int x, int y) : BaseClass(x, y), d(10)
|
||||
{}
|
||||
|
||||
Derived1(int x, int y, int z, int w) : BaseClass(x, y, z), d(w)
|
||||
{}
|
||||
|
||||
void foo() override
|
||||
{
|
||||
d = 13;
|
||||
}
|
||||
};
|
||||
|
||||
class Derived2 : public Derived1
|
||||
{
|
||||
public:
|
||||
|
||||
Derived2(int x, int y) : Derived1(x, y)
|
||||
{}
|
||||
|
||||
Derived2(int x, int y, int z, int w) : Derived1(x, y, z, w)
|
||||
{}
|
||||
|
||||
void foo() override
|
||||
{
|
||||
d = 17;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void SitMapUnitTest::virtualInheritances()
|
||||
{
|
||||
bool ok = true;
|
||||
qDebug() << endl << "Check Derived2(int x,int y,int z,int w)" << endl;
|
||||
try
|
||||
{
|
||||
Derived2 d(1, 2, 3, 4);
|
||||
d.foo();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ok = false;
|
||||
}
|
||||
QVERIFY2(ok, "virtualInheritances for Derived2(int x,int y,int z,int w) failed.");
|
||||
|
||||
qDebug() << endl << "Check Derived2(int x,int y)" << endl;
|
||||
try
|
||||
{
|
||||
Derived2 d(1, 2);
|
||||
d.foo();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ok = false;
|
||||
}
|
||||
QVERIFY2(ok, "virtualInheritances for Derived2(int x,int y) failed.");
|
||||
|
||||
QVERIFY2(VirtualBaseInterface::_ctorCount >= 2, "Too few calles of VirtualBaseInterface ctor.");
|
||||
QVERIFY2(VirtualBaseInterface::_ctorCount <= 2, "VirtualBaseInterface ctor has been called too often.");
|
||||
|
||||
} // SitMapUnitTest::virtualInheritances
|
||||
|
||||
|
||||
|
||||
class Referenced
|
||||
{
|
||||
public:
|
||||
Referenced() { _refCount++; }
|
||||
~Referenced() = default;
|
||||
|
||||
unsigned int refcount() { return _refCount; }
|
||||
|
||||
static unsigned int _refCount;
|
||||
};
|
||||
|
||||
unsigned int Referenced::_refCount = 0;
|
||||
|
||||
|
||||
class AbstractInterface : public virtual Referenced
|
||||
{
|
||||
public:
|
||||
AbstractInterface() = default;
|
||||
~AbstractInterface() = default;
|
||||
|
||||
virtual void foo() = 0;
|
||||
};
|
||||
|
||||
|
||||
class AbstractInterfaceImpl : public virtual AbstractInterface
|
||||
{
|
||||
unsigned int _data;
|
||||
|
||||
public:
|
||||
|
||||
AbstractInterfaceImpl() : AbstractInterface() { _data = 42; }
|
||||
~AbstractInterfaceImpl() { _data = 0; }
|
||||
void foo() override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
class ObjectInterface : public virtual AbstractInterface
|
||||
{
|
||||
public:
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Using the default constructor here like
|
||||
// ObjectInterface() = default;
|
||||
// gives a crash!!!!
|
||||
// Implementing the ctor works.
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
ObjectInterface() : AbstractInterface() {;}
|
||||
~ObjectInterface() = default;
|
||||
|
||||
virtual void foo2() = 0;
|
||||
};
|
||||
|
||||
|
||||
class ObjectInterfaceImpl : public AbstractInterfaceImpl, public virtual ObjectInterface
|
||||
{
|
||||
unsigned int _objData;
|
||||
public:
|
||||
explicit ObjectInterfaceImpl(unsigned int data = 7)
|
||||
: ObjectInterface(), AbstractInterfaceImpl()
|
||||
{
|
||||
_objData = data;
|
||||
}
|
||||
|
||||
~ObjectInterfaceImpl()
|
||||
{
|
||||
_objData = 0;
|
||||
}
|
||||
|
||||
void foo2() override;
|
||||
};
|
||||
|
||||
void AbstractInterfaceImpl::foo() { _data = 4711; }
|
||||
void ObjectInterfaceImpl::foo2() { _objData = 815; }
|
||||
|
||||
|
||||
void SitMapUnitTest::multiInheritancesVisualStudio2015Bug()
|
||||
{
|
||||
Referenced::_refCount = 0;
|
||||
|
||||
bool ok = true;
|
||||
qDebug() << endl << "Check ctor ObjectInterfaceImpl " << endl;
|
||||
try
|
||||
{
|
||||
ObjectInterfaceImpl obj;
|
||||
obj.foo();
|
||||
if (obj.refcount() != 1) ok = false;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ok = false;
|
||||
}
|
||||
QVERIFY2(ok, "Check ctor ObjectInterfaceImpl failed.");
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user