diff --git a/.gitignore b/.gitignore
index 602476d2..846aaca3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,12 @@
+.idea
.DS_Store
-depthmapX-build
\ No newline at end of file
+depthmapX-build
+build
+RegressionTest/rundir
+__pycache__
+depthmapX.pro.user
+*_BACKUP_*
+*_BASE_*
+*_LOCAL_*
+*_REMOTE_*
+
diff --git a/.travis.yml b/.travis.yml
index cdde9e1e..87e884df 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,18 +1,18 @@
sudo: required
-dist: trusty
+dist: xenial
+language: c++
+services:
+ - docker
-before_install:
- - sudo add-apt-repository --yes ppa:beineri/opt-qt571-trusty
- - sudo add-apt-repository --yes ppa:fkrull/deadsnakes
- - sudo apt-get update -qq
+notifications:
+ slack: depthmapx:B3CKNlNDLrNz1vSOU5yoQQqA
+ webhooks:
+ urls:
+ - "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MG9yYW5nZS12ZXJ0ZXglM0FtYXRyaXgub3JnLyUyMUVZQUZRaEVrV3lDZm1hcm9QaCUzQW1hdHJpeC5vcmc"
+ on_success: always # always|never|change
+ on_failure: always
+ on_start: never
-install:
- - sudo apt-get -y install qt573d qt57tools libgl1-mesa-dev libglu1-mesa-dev python3.5
script:
- - source /opt/qt57/bin/qt57-env.sh
- - mkdir build && cd build
- - /opt/qt57/bin/qmake ../depthmapX.pro
- - make
- - ./cliTest/cliTest && ./GuiUnitTest/GuiUnitTest
- - cd ../RegressionTest && python3.5 test_main.py && python3.5 RegressionTestRunner.py
+ - docker run --security-opt seccomp:unconfined --user $UID -v $PWD:/mnt/code blackseamonster/depthmapx-buildenv:0.3 bash -c ci/build.sh
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 00000000..dd75dc6e
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,50 @@
+project(depthmapX)
+cmake_minimum_required(VERSION 3.13.0)
+set(CMAKE_CXX_STANDARD 11)
+
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set(warnings "-Wall -Wextra")
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ set(warnings "/W4 /EHsc")
+ execute_process(COMMAND make_version_header.bat WORKING_DIRECTORY depthmapX)
+endif()
+
+# policy for target sources - we don't expect any old CMakes
+cmake_policy(SET CMP0076 NEW)
+
+include_directories(".")
+
+# Get the current working branch
+execute_process(
+ COMMAND git rev-parse --abbrev-ref HEAD
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ OUTPUT_VARIABLE APP_BRANCH
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+# Get the latest abbreviated commit hash of the working branch
+execute_process(
+ COMMAND git log -1 --format=%h
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ OUTPUT_VARIABLE APP_COMMIT
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+# generate version_defs.h
+include_directories(${CMAKE_BINARY_DIR})
+configure_file("${CMAKE_SOURCE_DIR}/version_defs.h.in" "${CMAKE_BINARY_DIR}/version_defs.h" @ONLY)
+
+string(TIMESTAMP APP_DATE %Y-%m-%d)
+
+add_subdirectory(genlib)
+add_subdirectory(genlibTest)
+add_subdirectory(salalib)
+add_subdirectory(mgraph440)
+add_subdirectory(mgraph440Test)
+add_subdirectory(salaTest)
+add_subdirectory(depthmapXcli)
+add_subdirectory(cliTest)
+add_subdirectory(depthmapXTest)
+add_subdirectory(depthmapX)
+add_subdirectory(GuiUnitTest)
diff --git a/GuiApp/GuiApp.pro b/GuiApp/GuiApp.pro
deleted file mode 100644
index 1ac283f4..00000000
--- a/GuiApp/GuiApp.pro
+++ /dev/null
@@ -1,24 +0,0 @@
-include(../defaults.pri)
-
-QT += core gui opengl widgets
-DEFINES += _DEPTHMAP
-TEMPLATE = app
-TARGET =depthmapX
-
-SOURCES = main.cpp
-
-
-win32:Release:LIBS += -L../depthmapX/release -L../genlib/release -L../salalib/release
-win32:Debug:LIBS += -L../depthmapX/debug -L../genlib/debug -L../salalib/debug
-!win32:LIBS += -L../depthmapX -L../genlib -L../salalib
-
-LIBS += -ldepthmapX -lsalalib -lgenlib
-
-!win32:!macx:LIBS += -L/usr/lib/i386-linux-gnu/
-
-!win32:!macx:LIBS += -lGL -lGLU
-
-
-win32:LIBS += -lOpenGl32 -lglu32 -lgdi32
-
-
diff --git a/GuiApp/main.cpp b/GuiApp/main.cpp
deleted file mode 100644
index 591f1ff4..00000000
--- a/GuiApp/main.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (C) 2011-2012, Tasos Varoudis
-// Copyright (C) 2017 Christian Sailer
-
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see .
-
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "mainwindowfactory.h"
-#include "version.h"
-
-#ifdef _WIN32
-#include
-#endif
-
-//////// dX Simple //
-// Search for #ifndef _COMPILE_dX_SIMPLE_VERSION in order to force "simple dX" compile
-
-
-int main(int argc, char *argv[])
-{
- Q_INIT_RESOURCE(resource);
-
- QApplication app(argc, argv);
-
- LicenseAgreementHolder dummy;
- dummy.get().setModal(true);
- dummy.get().setWindowTitle(TITLE_BASE);
- dummy.get().exec();
- if ( dummy.get().result() == dummy.get().Rejected ) return 0;
-
- QSplashScreen *splash = 0;
- int screenId = QApplication::desktop()->screenNumber();
- splash = new QSplashScreen(QPixmap(QLatin1String("images/splash.png")));
- if (QApplication::desktop()->isVirtualDesktop())
- {
- QRect srect(0, 0, splash->width(), splash->height());
- splash->move(QApplication::desktop()->availableGeometry(screenId).center() - srect.center() );
- }
- //splash->show();
-
- MainWindowHolder mainWindow;
- mainWindow.get().show();
-
- //splash->finish(&mainWin);
- return app.exec();
-}
diff --git a/GuiUnitTest/CMakeLists.txt b/GuiUnitTest/CMakeLists.txt
new file mode 100644
index 00000000..7dcc3406
--- /dev/null
+++ b/GuiUnitTest/CMakeLists.txt
@@ -0,0 +1,22 @@
+set(GuiUnitTest GuiUnitTest)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+# Find the QtWidgets library
+find_package(Qt5 COMPONENTS Core Widgets Gui OpenGL REQUIRED)
+# Instruct CMake to run moc automatically when needed
+set(CMAKE_AUTOMOC ON)
+
+set(guiUnitTest_SRCS
+ main.cpp
+ testviewhelpers.cpp
+ testsettings.cpp
+ ../depthmapX/settingsimpl.cpp
+ ../depthmapX/views/viewhelpers.cpp)
+
+include_directories("../ThirdParty/Catch" "../ThirdParty/FakeIt" "../depthmapX")
+
+set(LINK_LIBS salalib genlib mgraph440 Qt5::Core)
+
+add_executable(${GuiUnitTest} ${guiUnitTest_SRCS})
+target_link_libraries(${GuiUnitTest} ${LINK_LIBS})
+
diff --git a/GuiUnitTest/GuiUnitTest.pro b/GuiUnitTest/GuiUnitTest.pro
deleted file mode 100644
index da3d6986..00000000
--- a/GuiUnitTest/GuiUnitTest.pro
+++ /dev/null
@@ -1,33 +0,0 @@
-include(../defaults.pri)
-QT += core
-QT -= gui
-
-CONFIG += c++11
-
-TARGET = GuiUnitTest
-CONFIG += console
-CONFIG -= app_bundle
-INCLUDEPATH += ../ThirdParty/Catch
-
-TEMPLATE = app
-
-SOURCES += main.cpp \
- testviewhelpers.cpp
-
-win32:Release:LIBS += -L../depthmapX/release
-win32:Debug:LIBS += -L../depthmapX/debug
-!win32:LIBS += -L../depthmapX
-
-LIBS += -ldepthmapX
-
-
-# The following define makes your compiler emit warnings if you use
-# any feature of Qt which as been marked deprecated (the exact warnings
-# depend on your compiler). Please consult the documentation of the
-# deprecated API in order to know how to port your code away from it.
-DEFINES += QT_DEPRECATED_WARNINGS
-
-# You can also make your code fail to compile if you use deprecated APIs.
-# In order to do so, uncomment the following line.
-# You can also select to disable deprecated APIs only up to a certain version of Qt.
-#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
diff --git a/GuiUnitTest/testsettings.cpp b/GuiUnitTest/testsettings.cpp
new file mode 100644
index 00000000..5cfdcce0
--- /dev/null
+++ b/GuiUnitTest/testsettings.cpp
@@ -0,0 +1,57 @@
+// Copyright (C) 2017 Christian Sailer
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#include
+#include <../cliTest/selfcleaningfile.h>
+#include <../depthmapX/settingsimpl.h>
+
+
+class TestSettingsFactory : public QSettingsFactory
+{
+public:
+ TestSettingsFactory(const QString &filename) : mFilename(filename)
+ {}
+ virtual std::unique_ptr getSettings() const
+ {
+ return std::unique_ptr(new QSettings(mFilename, QSettings::IniFormat));
+ }
+private:
+ QString mFilename;
+};
+
+TEST_CASE("Test simple settings")
+{
+ SelfCleaningFile scf("./test.ini");
+ SettingsImpl settings(new TestSettingsFactory(scf.Filename().c_str()));
+
+ REQUIRE(settings.readSetting("test1", "bar").toString().toStdString() == "bar");
+ settings.writeSetting("test1", "foo");
+ REQUIRE(settings.readSetting("test1", "bar").toString().toStdString() == "foo");
+}
+
+
+TEST_CASE("Test settings transaction")
+{
+ SelfCleaningFile scf("./test.ini");
+ SettingsImpl settings(new TestSettingsFactory(scf.Filename().c_str()));
+
+ REQUIRE(settings.readSetting("test1", "bar").toString() == "bar");
+ {
+ auto transaction = settings.getTransaction();
+ transaction->writeSetting("test1", "foo");
+ }
+ REQUIRE(settings.readSetting("test1", "bar").toString() == "foo");
+
+}
diff --git a/GuiUnitTest/testviewhelpers.cpp b/GuiUnitTest/testviewhelpers.cpp
index 414674c3..224226d6 100644
--- a/GuiUnitTest/testviewhelpers.cpp
+++ b/GuiUnitTest/testviewhelpers.cpp
@@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-#include "viewhelpers.h"
+#include "depthmapX/views/viewhelpers.h"
#include "catch.hpp"
#include
#include
@@ -22,12 +22,12 @@
TEST_CASE("Calculating the new center", "[calculateCenter]"){
auto point = QPoint(100, 100);
auto oldCenter = QPoint(200,200);
- auto newCenter = QPoint(150,150);
+ auto newCenter = Point2f(150,150);
REQUIRE(ViewHelpers::calculateCenter(point, oldCenter, 0.5) == newCenter);
- newCenter.rx() = 300;
- newCenter.ry() = 300;
+ newCenter.x = 300;
+ newCenter.y = 300;
REQUIRE(ViewHelpers::calculateCenter(point, oldCenter, 2.0) == newCenter);
@@ -38,9 +38,9 @@ TEST_CASE("Date string format", "[getCurrentDate]"){
const tm* ltime = localtime(&now);
std::stringstream sstream;
sstream << ltime->tm_year + 1900 << "/" <<
- setfill('0') << setw(2) << ltime->tm_mon + 1 << "/" <<
- setfill('0') << setw(2) << ltime->tm_mday << std::flush;
+ std::setfill('0') << std::setw(2) << ltime->tm_mon + 1 << "/" <<
+ std::setfill('0') << std::setw(2) << ltime->tm_mday << std::flush;
- REQUIRE(ViewHelpers::getCurrentDate() == pstring(sstream.str().c_str()));
+ REQUIRE(ViewHelpers::getCurrentDate() == sstream.str().c_str());
}
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..aed5c3e4
--- /dev/null
+++ b/README.md
@@ -0,0 +1,28 @@
+## depthmapX - multi-platform spatial network analyses software
+
+
+This is the home for the development of depthmapX.
+
+
+Latest releases can be found at the [releases page](https://github.com/SpaceGroupUCL/depthmapX/releases)
+
+
+For any issues/bugs/crashes please create [a new issue](https://github.com/SpaceGroupUCL/depthmapX/issues/new)
+
+
+For more information please check the [documentation](./docs/index.md) and the [wiki](https://github.com/SpaceGroupUCL/depthmapX/wiki)
+
+[About depthmapX](./docs/about.md)
+
+
+##
+
+depthmapX is licensed under the [GPLv3](http://www.gnu.org/licenses/gpl-3.0.html) licence.
+
+depthmapX uses [Qt5](http://www.qt.io) as UI toolkit and build system, [Catch](https://github.com/philsquared/catch) as unit testing framework and [FakeIt](https://github.com/eranpeer/FakeIt) for test mocks.
+
+Please join the depthmapX mail distribution list at www.jiscmail.ac.uk/lists/DEPTHMAP.html for updates.
+
+The developers and users of depthmapX can also be found on matrix/riot for more direct and extended discussions in the following channels:
+- [depthmapX-users](https://riot.im/app/#/room/#depthmapX-users:matrix.org) - for general discussion, and questions about using depthmapX
+- [depthmapX-devel](https://riot.im/app/#/room/#depthmapX-devel:matrix.org) - for development discussion
diff --git a/RegressionTest/BaselineBinaries/Darwin/depthmapXcli b/RegressionTest/BaselineBinaries/Darwin/depthmapXcli
new file mode 100755
index 00000000..644a8d4f
Binary files /dev/null and b/RegressionTest/BaselineBinaries/Darwin/depthmapXcli differ
diff --git a/RegressionTest/BaselineBinaries/Linux/depthmapXcli b/RegressionTest/BaselineBinaries/Linux/depthmapXcli
index 0273940d..eb2155da 100755
Binary files a/RegressionTest/BaselineBinaries/Linux/depthmapXcli and b/RegressionTest/BaselineBinaries/Linux/depthmapXcli differ
diff --git a/RegressionTest/BaselineBinaries/Windows/depthmapXcli.exe b/RegressionTest/BaselineBinaries/Windows/depthmapXcli.exe
index 03a63c33..fd384046 100644
Binary files a/RegressionTest/BaselineBinaries/Windows/depthmapXcli.exe and b/RegressionTest/BaselineBinaries/Windows/depthmapXcli.exe differ
diff --git a/RegressionTest/RegressionTestRunner.py b/RegressionTest/RegressionTestRunner.py
old mode 100644
new mode 100755
index dac68c18..6e8219b0
--- a/RegressionTest/RegressionTestRunner.py
+++ b/RegressionTest/RegressionTestRunner.py
@@ -1,7 +1,9 @@
import runhelpers
import config
import depthmaprunner
+import performancerunner
import os
+import sys
defaultConfigFile = "regressionconfig.json"
@@ -17,12 +19,17 @@ def __init__(self, configfile, runfunc):
def run(self):
if not os.path.exists(self.config.rundir):
os.makedirs(self.config.rundir)
- runner = depthmaprunner.DepthmapRegressionRunner( self.runfunc, self.baseBinary, self.testBinary, self.config.rundir )
+ if self.config.performanceRegression.enabled:
+ print("Performance regression runs enabled")
+ runner = performancerunner.PerformanceRunner(self.runfunc, self.baseBinary, self.testBinary, self.config.rundir,self.config.performanceRegression )
+ else:
+ print("Default regression runs - no performance")
+ runner = depthmaprunner.DepthmapRegressionRunner( self.runfunc, self.baseBinary, self.testBinary, self.config.rundir )
good = True
for name, case in self.config.testcases.items():
print("Running test case " + name)
- success, output = runner.runTestCase(name, case.cmd.infile, case.cmd.outfile, case.cmd.mode, case.cmd.simpleMode, case.cmd.modeLines)
+ success, output = runner.runTestCase(name, case)
if not success:
good = False
print ("Failed:\n" + output)
@@ -31,7 +38,13 @@ def run(self):
return good
if __name__ == "__main__":
- r = RegressionTestRunner(defaultConfigFile, runhelpers.runExecutable)
+ print("Starting up RegressionTestRunner")
+ configFile = defaultConfigFile
+ if len(sys.argv) == 2:
+ configFile = sys.argv[1]
+ print("Config file in use is: " + configFile)
+ r = RegressionTestRunner(configFile, runhelpers.runExecutable)
+ print("Setup complete, starting run")
if not r.run():
exit(-1)
diff --git a/RegressionTest/cmdlinewrapper.py b/RegressionTest/cmdlinewrapper.py
index 19fe943e..b661388b 100644
--- a/RegressionTest/cmdlinewrapper.py
+++ b/RegressionTest/cmdlinewrapper.py
@@ -9,7 +9,8 @@ def __init__(self):
self.outfile = None
self.simpleMode = False
self.mode = None
- self.modeLines = []
+ self.extraArgs = {}
+ self.timingFile = None
def toCmdArray(self):
@@ -22,26 +23,19 @@ def toCmdArray(self):
args = ["-f", self.infile, "-o", self.outfile, "-m", self.mode]
if self.simpleMode:
args.append("-s")
+
+ if self.timingFile:
+ args.extend(["-t", self.timingFile])
- for modeLine in self.modeLines:
- args.extend(modeLine.toCmdArray())
+ for key, value in self.extraArgs.items():
+ if isinstance(value, list):
+ for v in value:
+ args.append(key)
+ args.append(v)
+ else:
+ args.append(key)
+ if value:
+ args.append(value)
return args
-class VisibilityCmd():
- visibilityMode = None
- globalMeasures = False
- localMeasures = False
- radius = None
-
- def toCmdArray(self):
- if self.visibilityMode == None:
- raise CommandLineError("visibility mode must be defined")
- args = ["-vm", self.visibilityMode ]
- if self.globalMeasures:
- args.append("-vg")
- if self.localMeasures:
- args.append("-vl")
- if not self.radius == None:
- args.extend(["-vr", self.radius])
- return args
diff --git a/RegressionTest/config.py b/RegressionTest/config.py
index 081761f4..2940dab3 100644
--- a/RegressionTest/config.py
+++ b/RegressionTest/config.py
@@ -1,44 +1,25 @@
import json
import os.path
import cmdlinewrapper
+from performanceregressionconfig import PerformanceRegressionConfig
+
class ConfigError(Exception):
def __init__(self, message):
self.message = message
-def buildSubCmd( subType, subConfig ):
- if subType == "Visibility":
- scmd = cmdlinewrapper.VisibilityCmd()
- scmd.visibilityMode = subConfig["visibilityMode"]
- if "globalMeasures" in subConfig:
- scmd.globalMeasures = True
- if "localMeasures" in subConfig:
- scmd.localMeasures = True
- if "radius" in subConfig:
- scmd.radius = subConfig["radius"]
- return scmd;
- else:
- raise ConfigError("Unknown sub commandline config " + subType)
-
-def buildCmd(testcase):
- cmd = cmdlinewrapper.DepthmapCmd()
- cmd.infile = testcase["infile"]
- cmd.outfile = testcase["outfile"]
- cmd.mode = testcase["mode"]
- if "simple" in testcase and not testcase["simple"] == "false":
- cmd.simpleMode = True
- if "subcmds" in testcase:
- for (key, value) in testcase["subcmds"].items():
- cmd.modeLines.append(buildSubCmd(key, value))
- return cmd
-
-class TestCase():
- def __init__(self, cmd):
- self.cmd = cmd
-
-def buildTestcase(testcase, rundir, configdir):
- return TestCase(buildCmd(testcase))
-
+def buildCmd(testcaseSet):
+ cmds = [];
+ for testcase in testcaseSet:
+ cmd = cmdlinewrapper.DepthmapCmd()
+ cmd.infile = testcase["infile"]
+ cmd.outfile = testcase["outfile"]
+ cmd.mode = testcase["mode"]
+ if "simple" in testcase and not testcase["simple"] == "false":
+ cmd.simpleMode = True
+ cmd.extraArgs = testcase.get("extraArgs", {})
+ cmds.append(cmd)
+ return cmds
class RegressionConfig():
def __init__(self, filename):
@@ -48,8 +29,9 @@ def __init__(self, filename):
self.rundir = config["rundir"]
self.basebinlocation = config["basebinlocation"]
self.testbinlocation = config["testbinlocation"]
+ self.performanceRegression = PerformanceRegressionConfig(config.get("performance", None))
self.testcases = {}
for (name, tc) in config["testcases"].items():
- self.testcases[name] = buildTestcase(tc, self.rundir, configdir)
+ self.testcases[name] = buildCmd(tc)
diff --git a/RegressionTest/depthmaprunner.py b/RegressionTest/depthmaprunner.py
index 00618ef8..166ba1f7 100644
--- a/RegressionTest/depthmaprunner.py
+++ b/RegressionTest/depthmaprunner.py
@@ -3,6 +3,9 @@
import difflib
import pprint
+import runhelpers
+
+
class DepthmapRunner():
def __init__(self, runFunc, binary ):
self.__runFunc = runFunc
@@ -27,29 +30,36 @@ def __init__(self, runFunc, baseBinary, testBinary, workingDir):
self.__testRunner = DepthmapRunner(runFunc, testBinary)
self.__workingDir = workingDir
- def runTestCase(self, name, infile, outfile, mode, simpleMode = False, subcmds = []):
- cmd = cmdlinewrapper.DepthmapCmd()
- cmd.infile = infile
- cmd.outfile = outfile
- cmd.mode = mode
- cmd.simpleMode = simpleMode
- cmd.modeLines = subcmds
+ def makeBaseDir(self, name):
+ return os.path.join(self.__workingDir, name + "_base")
+
+ def makeTestDir(self, name):
+ return os.path.join(self.__workingDir, name + "_test")
+
+ def runTestCase(self, name, cmds):
+ runhelpers.prepareDirectory(self.makeBaseDir(name))
+ runhelpers.prepareDirectory(self.makeTestDir(name))
+ return self.runTestCaseImpl(name, cmds)
+
+ def runTestCaseImpl(self, name, cmds):
+ baseDir = self.makeBaseDir(name)
+ for step,cmd in enumerate(cmds):
+ (baseSuccess, baseOut) = self.__baseRunner.runDepthmap(cmd, baseDir)
+ if not baseSuccess:
+ print("Baseline run failed at step " + str(step) + " with arguments " + pprint.pformat(cmd.toCmdArray()))
+ print(baseOut)
+ return (False, "Baseline run failed at step: " + str(step))
- baseDir = os.path.join(self.__workingDir, name + "_base")
- (baseSuccess, baseOut) = self.__baseRunner.runDepthmap(cmd, baseDir)
- if not baseSuccess:
- print("Baseline run failed with arguments " + pprint.pformat(cmd.toCmdArray()))
- print(baseOut)
- return (False, "Baseline run failed")
- testDir = os.path.join(self.__workingDir, name + "_test")
- (testSuccess, testOut) = self.__testRunner.runDepthmap(cmd, testDir)
- if not testSuccess:
- print("Test run failed with arguments " + pprint.pformat(cmd.toCmdArray()))
- print(testOut)
- return (False, "Test run failed")
+ testDir = self.makeTestDir(name)
+ for step,cmd in enumerate(cmds):
+ (testSuccess, testOut) = self.__testRunner.runDepthmap(cmd, testDir)
+ if not testSuccess:
+ print("Test run failed at step " + str(step) + " with arguments " + pprint.pformat(cmd.toCmdArray()))
+ print(testOut)
+ return (False, "Test run failed at step: " + str(step))
- baseFile = os.path.join(baseDir, outfile)
- testFile = os.path.join(testDir, outfile)
+ baseFile = os.path.join(baseDir, cmds[-1].outfile)
+ testFile = os.path.join(testDir, cmds[-1].outfile)
if not os.path.exists(baseFile):
message = "Baseline output {0} does not exist".format(baseFile)
print (message)
diff --git a/RegressionTest/performance_regression.json b/RegressionTest/performance_regression.json
new file mode 100644
index 00000000..5bacea67
--- /dev/null
+++ b/RegressionTest/performance_regression.json
@@ -0,0 +1,184 @@
+{
+ "rundir": "rundir",
+ "basebinlocation": "../../BaselineBinaries",
+ "testbinlocation": "../../../build",
+ "performance":{},
+ "testcases": {
+ "vis_prep_dense_pointmap":[{
+ "infile": "../../../testdata/rect1x1.graph",
+ "outfile": "out.graph",
+ "mode": "VISPREP",
+ "extraArgs": {
+ "-pg": "0.02",
+ "-pp": "0.5,0.5"
+ }
+ }],
+ "visibility_local": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "visibility",
+ "-vl": ""
+ }
+ }],
+ "vga_isovist": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "isovist"
+ }
+ }],
+ "vga_angular": [{
+ "infile": "../../../testdata/turns_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "angular"
+ }
+ }],
+ "vga_metric": [{
+ "infile": "../../../testdata/turns_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "metric",
+ "-vr": "n"
+ }
+ }],
+ "vga_thru_vision": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "thruvision"
+ }
+ }],
+ "isovist_args": [{
+ "infile": "../../../testdata/gallery_empty.graph",
+ "outfile": "out.graph",
+ "mode": "ISOVIST",
+ "extraArgs":
+ {
+ "-ii": ["1.77,6.6,90,30", "3.1,5.6,270,90" ]
+ }
+ }],
+ "visibility_global_n": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "visibility",
+ "-vg": "1",
+ "-vr": "n"
+ }
+ }],
+ "axial_makelines": [{
+ "infile": "../../../testdata/gallery_empty.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs":{
+ "-xl": "3,5",
+ "-xf": ""
+ }
+ }],
+ "axial_rn": [{
+ "infile": "../../../testdata/barnsbury_extended2_axial.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "n"
+ }
+ }],
+ "axial_rn_choice": [{
+ "infile": "../../../testdata/barnsbury_extended2_axial.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "n",
+ "-xac": ""
+ }
+ }],
+ "axial_rn_local": [{
+ "infile": "../../../testdata/barnsbury_extended2_axial.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "n",
+ "-xal": ""
+ }
+ }],
+ "segment_tulip_1024_rn_steps": [{
+ "infile": "../../../testdata/barnsbury_extended1_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "1024",
+ "-sr": "n",
+ "-srt": "steps"
+ }
+ }],
+ "segment_tulip_1024_rn_steps_choice": [{
+ "infile": "../../../testdata/barnsbury_extended1_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "1024",
+ "-sr": "n",
+ "-srt": "steps",
+ "-sic": ""
+ }
+ }],
+ "segment_tulip_1024_rn_steps_weighted": [{
+ "infile": "../../../testdata/barnsbury_extended1_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "1024",
+ "-sr": "n",
+ "-srt": "steps",
+ "-swa": "Segment Length"
+ }
+ }],
+ "segment_topological_rn": [{
+ "infile": "../../../testdata/barnsbury_extended1_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "topological",
+ "-sr": "n"
+ }
+ }],
+ "segment_metric_rn": [{
+ "infile": "../../../testdata/barnsbury_extended1_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "metric",
+ "-sr": "n"
+ }
+ }],
+ "convert_drawing_axial":[{
+ "infile": "../../../testdata/barnsbury_extended2_drawing.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "axial",
+ "-con": "Axial Map Test"
+ }
+ }],
+ "convert_axial_segment":[{
+ "infile": "../../../testdata/barnsbury_extended2_axial.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "segment",
+ "-con": "Segment Map Test"
+ }
+ }]
+ }
+}
diff --git a/RegressionTest/performanceregressionconfig.py b/RegressionTest/performanceregressionconfig.py
new file mode 100644
index 00000000..ee501bf6
--- /dev/null
+++ b/RegressionTest/performanceregressionconfig.py
@@ -0,0 +1,24 @@
+
+
+class PerformanceRegressionConfig:
+ """ Encapsulate performance regression config
+ This takes an optional performance regression config. All Elements
+ in the performance regression config are optional. If it is None
+ completly, performance regresssion will be disabled
+ "peformanceRegression":
+ {
+ enabled = 1, <- enabling performance regression - only required if nothing else is set, the existence of a non null config will turn on performance regression
+ runsPerInstance = 3, <- how many runs of each run def to run and average over
+ relativeThresholdInPercent = 1.5, <- how many percent can the new version be slower without failing
+ absoluteThresholdInSeconds = 2.3, <- how many seconds the new version can be slower without failing
+ of the two above, breaching the lower one will lead to failure.
+ }
+ """
+ def __init__(self, perfConfig):
+ if None == perfConfig or ("enabled" in perfConfig and perfConfig["enabled"] not in ["True", "true", "1", "yes"]):
+ self.enabled = False
+ return
+ self.enabled = True;
+ self.runsPerInstance = int(perfConfig.get("runsPerInstance", 3))
+ self.relativeThresholdInPercent = float(perfConfig.get("relativeThresholdInPercent", 1))
+ self.absoluteThresholdInSeconds = float(perfConfig.get("absoluteThresholdInSeconds",1))
diff --git a/RegressionTest/performancerunner.py b/RegressionTest/performancerunner.py
new file mode 100644
index 00000000..beb9473d
--- /dev/null
+++ b/RegressionTest/performancerunner.py
@@ -0,0 +1,109 @@
+from statistics import mean
+from collections import OrderedDict
+
+import depthmaprunner
+import os
+import csv
+
+import runhelpers
+from performanceregressionconfig import PerformanceRegressionConfig
+
+def checkPerformance(baseFile, testFile, relativeThreshold, absoluteThreshold):
+ """
+ Check the performance of 2 depthmap runs against each other
+ This function expects the timing from a base and test run and parses them
+ as CSV. For now, it expects the entries to be the same. It will return an
+ error message if
+ * one or both of the files are missing
+ * the number of lines or the labels don't match
+ * the test run is more than 5 seconds or 5% slower than the baseline
+ (whatever is greater)
+ """
+ if not os.path.exists(baseFile):
+ return "Base performance timing file {0} is missing".format(baseFile)
+ if not os.path.exists(testFile):
+ return "Test performance timing file {0} is missing".format(testFile)
+ with open(baseFile) as baseHandle, open(testFile) as testHandle:
+ baseReader = csv.DictReader(baseHandle)
+ testReader = csv.DictReader(testHandle)
+
+ baseDone = False
+ testDone = False
+
+ while True:
+ try:
+ baseLine = next(baseReader)
+ except StopIteration:
+ baseDone = True
+
+ try:
+ testLine = next(testReader)
+ except StopIteration:
+ testDone = True
+
+ if baseDone and testDone:
+ return ""
+ if baseDone and not testDone:
+ return "baseline performance file {0} has fewer lines than the test one {1}".format(baseFile, testFile)
+ if testDone and not baseDone:
+ return "baseline performance file {0} has more lines than the test one {1}".format(baseFile, testFile)
+
+ if not baseLine["action"] == testLine["action"]:
+ return "performance line mismatch: base '{0}', test '{1}'".format(baseLine["action"], testLine["action"])
+
+ baseTime = float(baseLine["average"])
+ testTime = float(testLine["average"])
+
+ allowance = max(absoluteThreshold, baseTime * relativeThreshold / 100 )
+ if testTime > baseTime + allowance:
+ return "Performance regression: {0} took {1}s instead of {2}s".format(baseLine["action"], testLine["average"], baseLine["average"])
+
+def aggregatePerformanceStats(dir, numRuns, numCmds, filenameTemplate ):
+ data = OrderedDict()
+ totalValues = []
+ for i in range(numRuns):
+ for j in range(numCmds):
+ with open(os.path.join(dir, filenameTemplate.format(i, j)), "r") as f:
+ reader = csv.DictReader(f)
+ total = 0
+ for line in reader:
+ if not line["action"] in data:
+ data[line["action"]] = []
+ data[line["action"]].append(float(line["duration"]))
+ total = total + float(line["duration"])
+ totalValues.append(total)
+ data["total"] = totalValues
+
+ outputFile =os.path.join(dir, filenameTemplate.format("", "all"))
+ with open(outputFile, "w+") as f:
+ writer = csv.DictWriter(f, ["action", "min", "max", "average"])
+ writer.writeheader()
+ for key, val in data.items():
+ rowDict = {"action": key, "min": min(val), "max": max(val), "average": mean(val)}
+ writer.writerow(rowDict)
+ return outputFile
+
+class PerformanceRunner(depthmaprunner.DepthmapRegressionRunner):
+ def __init__(self, runFunc, baseBinary, testBinary, workingDir, perfConfig):
+ depthmaprunner.DepthmapRegressionRunner.__init__(self,runFunc,baseBinary,testBinary,workingDir)
+ self.perfConfig = perfConfig
+
+ def runTestCase(self, name, cmds):
+ runhelpers.prepareDirectory(self.makeBaseDir(name))
+ runhelpers.prepareDirectory(self.makeTestDir(name))
+
+ nameTemplate = "timings_{0}_{1}.csv"
+ for i in range(self.perfConfig.runsPerInstance):
+ print ("Running test case {0}, run {1} of {2}".format(name, i, self.perfConfig.runsPerInstance))
+ for j in range(len(cmds)):
+ cmds[j].timingFile = nameTemplate.format(i,j)
+ result, message = self.runTestCaseImpl(name, cmds)
+ if not result:
+ return (False, "Run {0} failed with message: {1}".format(i, message))
+
+ testFile = aggregatePerformanceStats(self.makeTestDir(name),self.perfConfig.runsPerInstance, len(cmds), nameTemplate)
+ baseFile = aggregatePerformanceStats(self.makeBaseDir(name),self.perfConfig.runsPerInstance, len(cmds), nameTemplate)
+ message = checkPerformance(testFile, baseFile, self.perfConfig.relativeThresholdInPercent, self.perfConfig.absoluteThresholdInSeconds)
+ if message:
+ return (False, message)
+ return (True, "")
\ No newline at end of file
diff --git a/RegressionTest/regressionconfig.json b/RegressionTest/regressionconfig.json
index 5e0925fa..021bbc86 100644
--- a/RegressionTest/regressionconfig.json
+++ b/RegressionTest/regressionconfig.json
@@ -3,16 +3,908 @@
"basebinlocation": "../../BaselineBinaries",
"testbinlocation": "../../../build",
"testcases": {
- "visibility_local": {
+ "links_pointmap_manual": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "LINK",
+ "extraArgs": {
+ "-lnk": ["1.32,7.24,4.88,5.24","1.16,5.28,3.28,7.12"]
+ }
+ }],
+ "links_pointmap_file": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "LINK",
+ "extraArgs": {
+ "-lf": "../../../testdata/gallery_connected_merge_links.txt"
+ }
+ }],
+ "unlinks_shapegraph_coords": [{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.graph",
+ "mode": "LINK",
+ "extraArgs": {
+ "-lmt": "shapegraphs",
+ "-lm": "unlink",
+ "-lt": "coords",
+ "-lnk": "530797,184255"
+ }
+ }],
+ "unlinks_shapegraph_refs": [{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.graph",
+ "mode": "LINK",
+ "extraArgs": {
+ "-lmt": "shapegraphs",
+ "-lm": "unlink",
+ "-lt": "refs",
+ "-lnk": "18,24"
+ }
+ }],
+ "links_shapegraph_coords": [{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.graph",
+ "mode": "LINK",
+ "extraArgs": {
+ "-lmt": "shapegraphs",
+ "-lm": "link",
+ "-lt": "coords",
+ "-lnk": "530684,184098,531388,184353"
+ }
+ }],
+ "links_shapegraph_refs": [{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.graph",
+ "mode": "LINK",
+ "extraArgs": {
+ "-lmt": "shapegraphs",
+ "-lm": "link",
+ "-lt": "refs",
+ "-lnk": "1,41"
+ }
+ }],
+ "links_shapegraph_refs_non_cont_keys": [{
+ "infile": "../../../testdata/axmap_noncont_keys.graph",
+ "outfile": "out.graph",
+ "mode": "LINK",
+ "extraArgs": {
+ "-lmt": "shapegraphs",
+ "-lm": "link",
+ "-lt": "refs",
+ "-lnk": "17,11"
+ }
+ }],
+ "visibility_local": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "visibility",
+ "-vl": ""
+ }
+ }],
+ "visibility_local_only_map": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "visibility",
+ "-vl": ""
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.csv",
+ "mode": "EXPORT",
+ "extraArgs": {
+ "-em": "pointmap-data-csv"
+ }
+ }],
+ "visibility_global_with_multiple_pointmaps": [{
+ "infile": "../../../testdata/gallery_two_pointmaps.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "visibility",
+ "-vg": "",
+ "-vr": "3"
+ }
+ }],
+ "visibility_global_3": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "visibility",
+ "-vg": "",
+ "-vr": "3"
+ }
+ }],
+ "visibility_global_3_only_map": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "visibility",
+ "-vg": "",
+ "-vr": "3"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.csv",
+ "mode": "EXPORT",
+ "extraArgs": {
+ "-em": "pointmap-data-csv"
+ }
+ }],
+ "pointmap_export_links": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.csv",
+ "mode": "EXPORT",
+ "extraArgs": {
+ "-em": "pointmap-links-csv"
+ }
+ }],
+ "axial_export_map_csv": [{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.csv",
+ "mode": "EXPORT",
+ "extraArgs": {
+ "-em": "shapegraph-map-csv"
+ }
+ }],
+ "axial_export_map_mif_given_mif": [{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.mif",
+ "mode": "EXPORT",
+ "extraArgs": {
+ "-em": "shapegraph-map-mif"
+ }
+ }],
+ "axial_export_map_mif_given_mid": [{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.mid",
+ "mode": "EXPORT",
+ "extraArgs": {
+ "-em": "shapegraph-map-mif"
+ }
+ }],
+ "visibility_global_n": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "visibility",
+ "-vg": "",
+ "-vr": "n"
+ }
+ }],
+ "visibility_global_n_only_map": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "visibility",
+ "-vg": "",
+ "-vr": "n"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.csv",
+ "mode": "EXPORT",
+ "extraArgs": {
+ "-em": "pointmap-data-csv"
+ }
+ }],
+ "vga_isovist": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "isovist"
+ }
+ }],
+ "vga_isovist_only_map": [{
"infile": "../../../testdata/gallery_connected.graph",
"outfile": "out.graph",
"mode": "VGA",
- "subcmds": {
- "Visibility": {
- "visibilityMode": "visibility",
- "localMeasures": "1"
- }
+ "extraArgs": {
+ "-vm": "isovist"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.csv",
+ "mode": "EXPORT",
+ "extraArgs": {
+ "-em": "pointmap-data-csv"
+ }
+ }],
+ "vga_angular": [{
+ "infile": "../../../testdata/turns_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "angular"
+ }
+ }],
+ "vga_angular_only_map": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "angular"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.csv",
+ "mode": "EXPORT",
+ "extraArgs": {
+ "-em": "pointmap-data-csv"
+ }
+ }],
+ "vga_metric": [{
+ "infile": "../../../testdata/turns_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "metric",
+ "-vr": "n"
+ }
+ }],
+ "vga_metric_only_map": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "metric",
+ "-vr": "n"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.csv",
+ "mode": "EXPORT",
+ "extraArgs": {
+ "-em": "pointmap-data-csv"
+ }
+ }],
+ "vga_thru_vision": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "thruvision"
+ }
+ }],
+ "vga_thru_vision_only_map": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "VGA",
+ "extraArgs": {
+ "-vm": "thruvision"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.csv",
+ "mode": "EXPORT",
+ "extraArgs": {
+ "-em": "pointmap-data-csv"
+ }
+ }],
+ "vga_visual_step_depth": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "STEPDEPTH",
+ "extraArgs":{
+ "-sdp": "3,5",
+ "-sdt": "visual"
+ }
+ }],
+ "vga_metric_step_depth": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "STEPDEPTH",
+ "extraArgs":{
+ "-sdp": "3,5",
+ "-sdt": "metric"
+ }
+ }],
+ "vga_angular_step_depth": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "STEPDEPTH",
+ "extraArgs":{
+ "-sdp": "3,5",
+ "-sdt": "angular"
+ }
+ }],
+ "isovist_args": [{
+ "infile": "../../../testdata/gallery_empty.graph",
+ "outfile": "out.graph",
+ "mode": "ISOVIST",
+ "extraArgs":
+ {
+ "-ii": ["1.77,6.6,90,30", "3.1,5.6,270,90" ]
+ }
+ }],
+ "isovist_file": [{
+ "infile": "../../../testdata/gallery_empty.graph",
+ "outfile": "out.graph",
+ "mode": "ISOVIST",
+ "extraArgs":
+ {
+ "-if": "../../../testdata/isovists.csv"
+ }
+ }],
+ "axial_makelines": [{
+ "infile": "../../../testdata/gallery_empty.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs":{
+ "-xl": "3,5",
+ "-xf": ""
+ }
+ }],
+ "axial_rn": [{
+ "infile": "../../../testdata/simple_axlines.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "n"
+ }
+ }],
+ "axial_r3": [{
+ "infile": "../../../testdata/simple_axlines.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "3"
+ }
+ }],
+ "axial_rn_rra": [{
+ "infile": "../../../testdata/simple_axlines.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "n",
+ "-xar": ""
+ }
+ }],
+ "axial_rn_choice": [{
+ "infile": "../../../testdata/simple_axlines.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "n",
+ "-xac": ""
+ }
+ }],
+ "axial_rn_local": [{
+ "infile": "../../../testdata/simple_axlines.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "n",
+ "-xal": ""
+ }
+ }],
+ "axial_rn_noncont_keys": [{
+ "infile": "../../../testdata/axmap_noncont_keys.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "n"
+ }
+ }],
+ "axial_r3_noncont_keys": [{
+ "infile": "../../../testdata/axmap_noncont_keys.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "3"
+ }
+ }],
+ "axial_rn_rra_noncont_keys": [{
+ "infile": "../../../testdata/axmap_noncont_keys.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "n",
+ "-xar": ""
+ }
+ }],
+ "axial_rn_choice_noncont_keys": [{
+ "infile": "../../../testdata/axmap_noncont_keys.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "n",
+ "-xac": ""
+ }
+ }],
+ "axial_rn_local_noncont_keys": [{
+ "infile": "../../../testdata/axmap_noncont_keys.graph",
+ "outfile": "out.graph",
+ "mode": "AXIAL",
+ "extraArgs": {
+ "-xa": "n",
+ "-xal": ""
+ }
+ }],
+ "segment_tulip_1024_rn_steps": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "1024",
+ "-sr": "n",
+ "-srt": "steps"
+ }
+ }],
+ "segment_tulip_1024_rn_steps_choice": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "1024",
+ "-sr": "n",
+ "-srt": "steps",
+ "-sic": ""
+ }
+ }],
+ "segment_tulip_1024_rn_steps_weighted": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "1024",
+ "-sr": "n",
+ "-srt": "steps",
+ "-swa": "Segment Length"
+ }
+ }],
+ "segment_tulip_512_rn_steps": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "512",
+ "-sr": "n",
+ "-srt": "steps"
+ }
+ }],
+ "segment_tulip_123_rn_steps": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "123",
+ "-sr": "n",
+ "-srt": "steps"
+ }
+ }],
+ "segment_tulip_4_rn_steps": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "4",
+ "-sr": "n",
+ "-srt": "steps"
+ }
+ }],
+ "segment_tulip_1024_r5_steps": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "1024",
+ "-sr": "5",
+ "-srt": "steps"
+ }
+ }],
+ "segment_tulip_1024_rn_r5_steps": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "1024",
+ "-sr": "5,n",
+ "-srt": "steps"
+ }
+ }],
+ "segment_tulip_1024_r500_metric": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "1024",
+ "-sr": "500",
+ "-srt": "metric"
+ }
+ }],
+ "segment_tulip_1024_r180_angular": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "tulip",
+ "-stb": "1024",
+ "-sr": "500",
+ "-srt": "metric"
+ }
+ }],
+ "segment_angular_rn": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "angular",
+ "-sr": "n"
+ }
+ }],
+ "segment_topological_rn": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "topological",
+ "-sr": "n"
+ }
+ }],
+ "segment_metric_rn": [{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "SEGMENT",
+ "extraArgs": {
+ "-st": "metric",
+ "-sr": "n"
+ }
+ }],
+ "convert_drawing_axial":[{
+ "infile": "../../../testdata/barnsbury_drawing.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "axial",
+ "-con": "Axial Map Test"
+ }
+ }],
+ "convert_drawing_segment":[{
+ "infile": "../../../testdata/barnsbury_drawing.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "segment",
+ "-con": "Segment Map Test"
+ }
+ }],
+ "convert_drawing_segment_only_map":[{
+ "infile": "../../../testdata/barnsbury_drawing.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "segment",
+ "-con": "Segment Map Test"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.csv",
+ "mode": "EXPORT",
+ "extraArgs": {
+ "-em": "shapegraph-map-csv"
+ }
+ }],
+ "convert_drawing_convex":[{
+ "infile": "../../../testdata/polygons_drawing.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "convex",
+ "-con": "Convex Map Test"
+ }
+ }],
+ "convert_drawing_data_convex":[{
+ "infile": "../../../testdata/polygons_drawing.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "data",
+ "-con": "Data Map Test"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "convex",
+ "-con": "Convex Map Test"
+ }
+ }],
+ "convert_drawing_data_drawing_polygons":[{
+ "infile": "../../../testdata/polygons_drawing.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "data",
+ "-con": "Data Map Test"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "drawing",
+ "-con": "Drawing Map Test"
+ }
+ }],
+ "convert_drawing_data_drawing_lines":[{
+ "infile": "../../../testdata/barnsbury_drawing.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "data",
+ "-con": "Data Map Test"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "drawing",
+ "-con": "Drawing Map Test"
+ }
+ }],
+ "convert_axial_data":[{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "data",
+ "-con": "Data Map Test"
+ }
+ }],
+ "convert_axial_data_copy_attributes":[{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "data",
+ "-con": "Data Map Test",
+ "-coc":""
+ }
+ }],
+ "convert_axial_drawing":[{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "drawing",
+ "-con": "Drawing Map Test"
+ }
+ }],
+ "convert_axial_segment":[{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "segment",
+ "-con": "Segment Map Test"
+ }
+ }],
+ "convert_axial_segment_remove_input":[{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "segment",
+ "-con": "Segment Map Test",
+ "-cir":""
+ }
+ }],
+ "convert_axial_segment_trim_lines":[{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "segment",
+ "-con": "Segment Map Test",
+ "-crsl":"40"
+ }
+ }],
+ "convert_axial_data_axial":[{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "data",
+ "-con": "Data Map Test"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "axial",
+ "-con": "Axial Map Test"
+ }
+ }],
+ "convert_axial_data_axial_copy_attributes":[{
+ "infile": "../../../testdata/barnsbury_axial.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "data",
+ "-con": "Data Map Test",
+ "-coc": ""
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "axial",
+ "-con": "Axial Map Test",
+ "-coc": ""
+ }
+ }],
+ "convert_segment_data":[{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "data",
+ "-con": "Data Map Test"
+ }
+ }],
+ "convert_segment_data_segment":[{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "data",
+ "-con": "Data Map Test"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "axial",
+ "-con": "Segment Map Test"
+ }
+ }],
+ "convert_segment_data_segment_copy_attributes":[{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "data",
+ "-con": "Data Map Test",
+ "-coc": ""
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "axial",
+ "-con": "Segment Map Test",
+ "-coc": ""
+ }
+ }],
+ "convert_segment_drawing":[{
+ "infile": "../../../testdata/barnsbury_segment.graph",
+ "outfile": "out.graph",
+ "mode": "MAPCONVERT",
+ "extraArgs": {
+ "-co": "drawing",
+ "-con": "Drawing Map Test"
+ }
+ }],
+ "pointmap_create_fill_make_one_operation": [{
+ "infile": "../../../testdata/gallery_empty.graph",
+ "outfile": "out.graph",
+ "mode": "VISPREP",
+ "extraArgs": {
+ "-pg": "0.04",
+ "-pp": "1.32,7.24,4.88,5.24",
+ "-pm": ""
+ }
+ }],
+ "dense_pointmap_create_fill_make":[{
+ "infile": "../../../testdata/rect1x1.graph",
+ "outfile": "out.graph",
+ "mode": "VISPREP",
+ "extraArgs": {
+ "-pg": "0.02",
+ "-pp": "0.5,0.5"
+ }
+ }],
+ "pointmap_create_fill_make_unmake": [{
+ "infile": "../../../testdata/gallery_empty.graph",
+ "outfile": "out.graph",
+ "mode": "VISPREP",
+ "extraArgs": {
+ "-pg": "0.04"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "VISPREP",
+ "extraArgs": {
+ "-pp": "1.32,7.24,4.88,5.24"
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "VISPREP",
+ "extraArgs": {
+ "-pm": ""
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "VISPREP",
+ "extraArgs": {
+ "-pu": ""
+ }
+ }],
+ "pointmap_create_fill_make_link_unmake": [{
+ "infile": "../../../testdata/gallery_empty.graph",
+ "outfile": "out.graph",
+ "mode": "VISPREP",
+ "extraArgs": {
+ "-pg": "0.04",
+ "-pp": "1.32,7.24,4.88,5.24",
+ "-pm": ""
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "LINK",
+ "extraArgs": {
+ "-lnk": ["1.32,7.24,4.88,5.24","1.16,5.28,3.28,7.12"]
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "VISPREP",
+ "extraArgs": {
+ "-pu": ""
+ }
+ }],
+ "pointmap_create_fill_make_link_unmake_unlink": [{
+ "infile": "../../../testdata/gallery_empty.graph",
+ "outfile": "out.graph",
+ "mode": "VISPREP",
+ "extraArgs": {
+ "-pg": "0.04",
+ "-pp": "1.32,7.24,4.88,5.24",
+ "-pm": ""
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "LINK",
+ "extraArgs": {
+ "-lnk": ["1.32,7.24,4.88,5.24","1.16,5.28,3.28,7.12"]
+ }
+ },{
+ "infile": "out.graph",
+ "outfile": "out.graph",
+ "mode": "VISPREP",
+ "extraArgs": {
+ "-pu": "",
+ "-pl": ""
}
- }
+ }]
}
}
diff --git a/RegressionTest/regressionconfig_agents.json b/RegressionTest/regressionconfig_agents.json
new file mode 100644
index 00000000..6ede4043
--- /dev/null
+++ b/RegressionTest/regressionconfig_agents.json
@@ -0,0 +1,223 @@
+{
+ "rundir": "rundir",
+ "basebinlocation": "../../BaselineBinaries",
+ "testbinlocation": "../../../build",
+ "testcases": {
+ "agents_defaults": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "standard",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0"
+ }
+ }],
+ "agents_line_of_sight_length_look": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "los-length",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0"
+ }
+ }],
+ "agents_line_of_sight_length_look_only_map": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.tsv",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "los-length",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0",
+ "-ot": "gatecounts"
+ }
+ }],
+ "agents_occluded_length_look": [{
+ "infile": "../../../testdata/gallery_connected_with_isovist.graph",
+ "outfile": "out.graph",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "occ-length",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0"
+ }
+ }],
+ "agents_any_occlusion_look": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "occ-any",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0"
+ }
+ }],
+ "agents_occlusion_group_bins_45_look": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "occ-group-45",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0"
+ }
+ }],
+ "agents_occlusion_group_bins_60_look": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "occ-group-60",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0"
+ }
+ }],
+ "agents_furthest_occlusion_per_bin_look": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "occ-furthest",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0"
+ }
+ }],
+ "agents_per_bin_far_distance_look": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "bin-far-dist",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0"
+ }
+ }],
+ "agents_per_bin_angle_look": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "bin-angle",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0"
+ }
+ }],
+ "agents_per_bin_far_distance_and_angle_look": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "bin-far-dist-angle",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0"
+ }
+ }],
+ "agents_per_bin_memory_look": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.graph",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "bin-memory",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0"
+ }
+ }],
+ "agents_gatecounts": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.tsv",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "standard",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "5",
+ "-ot": "gatecounts"
+ }
+ }],
+ "agents_trails_all": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.cat",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "standard",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0",
+ "-atrails": "0",
+ "-ot": "trails"
+ }
+ }],
+ "agents_trails_1": [{
+ "infile": "../../../testdata/gallery_connected.graph",
+ "outfile": "out.cat",
+ "mode": "AGENTS",
+ "extraArgs": {
+ "-am": "standard",
+ "-ats": "5000",
+ "-arr": "0.1",
+ "-afov": "15",
+ "-asteps": "3",
+ "-alife": "1000",
+ "-alocseed": "0",
+ "-atrails": "1",
+ "-ot": "trails"
+ }
+ }]
+ }
+}
diff --git a/RegressionTest/runhelpers.py b/RegressionTest/runhelpers.py
index bda2e2f7..a57167b0 100644
--- a/RegressionTest/runhelpers.py
+++ b/RegressionTest/runhelpers.py
@@ -26,7 +26,6 @@ def prepareDirectory(dirname):
def runExecutable( workingDir, arguments ):
""" Prepares a clean run directoy and runs the process in this """
- prepareDirectory(workingDir)
with cd(workingDir):
with open("out.txt", "w") as outfile:
result = subprocess.run(arguments, stdout = outfile, stderr = subprocess.STDOUT )
diff --git a/RegressionTest/test/context.py b/RegressionTest/test/context.py
new file mode 100644
index 00000000..41274fd8
--- /dev/null
+++ b/RegressionTest/test/context.py
@@ -0,0 +1,11 @@
+import os
+import sys
+sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
+
+import cmdlinewrapper
+import config
+import depthmaprunner
+import RegressionTestRunner
+import runhelpers
+import performanceregressionconfig
+import performancerunner
\ No newline at end of file
diff --git a/RegressionTest/disposablefile.py b/RegressionTest/test/disposablefile.py
similarity index 100%
rename from RegressionTest/disposablefile.py
rename to RegressionTest/test/disposablefile.py
diff --git a/RegressionTest/fail/test_fail.py b/RegressionTest/test/fail/test_fail.py
similarity index 100%
rename from RegressionTest/fail/test_fail.py
rename to RegressionTest/test/fail/test_fail.py
diff --git a/RegressionTest/pass/test_pass.py b/RegressionTest/test/pass/test_pass.py
similarity index 100%
rename from RegressionTest/pass/test_pass.py
rename to RegressionTest/test/pass/test_pass.py
diff --git a/RegressionTest/test_RegressionTestRunner.py b/RegressionTest/test/test_RegressionTestRunner.py
similarity index 92%
rename from RegressionTest/test_RegressionTestRunner.py
rename to RegressionTest/test/test_RegressionTestRunner.py
index d975d9bc..1b389450 100644
--- a/RegressionTest/test_RegressionTestRunner.py
+++ b/RegressionTest/test/test_RegressionTestRunner.py
@@ -14,6 +14,8 @@ def runfunc(self, workingdir, args):
os.makedirs(workingdir)
with open(os.path.join(workingdir, "outfile.graph"), "w") as f:
f.write("123")
+ with open(os.path.join(workingdir, "runtimes.csv"), "w") as f:
+ f.write("action,duration\n")
return (True, "")
diff --git a/RegressionTest/test_cmdlinewrapper.py b/RegressionTest/test/test_cmdlinewrapper.py
similarity index 63%
rename from RegressionTest/test_cmdlinewrapper.py
rename to RegressionTest/test/test_cmdlinewrapper.py
index 4b98fb4a..cc856c4f 100644
--- a/RegressionTest/test_cmdlinewrapper.py
+++ b/RegressionTest/test/test_cmdlinewrapper.py
@@ -1,5 +1,7 @@
import unittest
-import cmdlinewrapper
+
+import collections
+from context import cmdlinewrapper
class TestDepthmapCmd(unittest.TestCase):
def test_correctBehaviour(self):
@@ -26,33 +28,17 @@ def test_exceptions(self):
cmd.toCmdArray()
self.assertEqual(cm.exception.message, "mode must be defined")
- def test_subcmd(self):
+ def test_extraArgs(self):
cmd = cmdlinewrapper.DepthmapCmd()
cmd.infile = "foo"
cmd.outfile = "bar"
cmd.mode = "visibility"
+ # use ordered dict here for testability
+ cmd.extraArgs = collections.OrderedDict([("-lnk", ["foo", "bar"]), ("-vm", "metric"), ("-vg", "" )])
- vis = cmdlinewrapper.VisibilityCmd()
- vis.visibilityMode = "metric"
- cmd.modeLines.append(vis)
-
- self.assertEqual(cmd.toCmdArray(), ["-f", "foo", "-o", "bar", "-m", "visibility", "-vm", "metric" ])
+ self.assertEqual(cmd.toCmdArray(), ["-f", "foo", "-o", "bar", "-m", "visibility", "-lnk", "foo", "-lnk", "bar", "-vm", "metric", "-vg" ])
-class TestVisibiltyCmd(unittest.TestCase):
- def test_correctBehaviour(self):
- cmd = cmdlinewrapper.VisibilityCmd()
- cmd.visibilityMode = "isovist"
- self.assertEqual(cmd.toCmdArray(), ["-vm", "isovist"])
- cmd.radius = "5"
- self.assertEqual(cmd.toCmdArray(), ["-vm", "isovist", "-vr", "5"])
- cmd.globalMeasures = True;
- self.assertEqual(cmd.toCmdArray(), ["-vm", "isovist", "-vg", "-vr", "5"])
- cmd.localMeasures = True;
- self.assertEqual(cmd.toCmdArray(), ["-vm", "isovist", "-vg", "-vl", "-vr", "5"])
-
-
-
if __name__ == "__main__":
unittest.main()
diff --git a/RegressionTest/test/test_config.py b/RegressionTest/test/test_config.py
new file mode 100644
index 00000000..c17c0b47
--- /dev/null
+++ b/RegressionTest/test/test_config.py
@@ -0,0 +1,50 @@
+import unittest
+from context import config
+from disposablefile import DisposableFile
+import RegressionTestRunner
+import os
+
+def writeConfig(filename, rundir):
+ with open(filename, "w") as f:
+ f.write('{ "rundir": "'+ rundir +'",\n')
+ f.write(' "basebinlocation": "../baselineBinaries",\n')
+ f.write(' "testbinlocation": "../..",\n')
+ f.write(' "testcases": {\n')
+ f.write(' "test1": [{\n')
+ f.write(' "infile": "infile.graph",\n')
+ f.write(' "outfile": "outfile.graph",\n')
+ f.write(' "mode": "VGA",\n')
+ f.write(' "extraArgs": {\n')
+ f.write(' "-vm": "metric",\n')
+ f.write(' "-vr": "7"}}]}}')
+
+
+
+class TestMethods(unittest.TestCase):
+ def test_buildCmd(self):
+ data = [{ "infile": "foo.graph", "outfile": "bar.graph", "mode": "VGA", "extraArgs": { "-vm": "visibility", "-vg": "", "-vr": "5"}}]
+ cmds = config.buildCmd( data )
+ self.assertEqual(cmds[0].infile, "foo.graph")
+ self.assertEqual(cmds[0].outfile, "bar.graph")
+ self.assertEqual(cmds[0].mode, "VGA")
+ self.assertEqual(len(cmds[0].extraArgs),3)
+
+
+ def test_configClass(self):
+ with DisposableFile("test.config") as testfile:
+ writeConfig(testfile.filename(), "../foo/bar")
+ conf = config.RegressionConfig(testfile.filename())
+ self.assertEqual(len(conf.testcases), 1)
+ self.assertEqual(conf.rundir, "../foo/bar")
+ self.assertTrue("test1" in conf.testcases)
+
+
+class TestRealConfig(unittest.TestCase):
+ def test_realConfig(self):
+ configFile = os.path.join("..", RegressionTestRunner.defaultConfigFile)
+ self.assertNotEqual( configFile, "" )
+ conf = config.RegressionConfig(configFile)
+ self.assertFalse(conf.performanceRegression.enabled)
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/RegressionTest/test_depthmaprunner.py b/RegressionTest/test/test_depthmaprunner.py
similarity index 75%
rename from RegressionTest/test_depthmaprunner.py
rename to RegressionTest/test/test_depthmaprunner.py
index 2e63498d..5a501c91 100644
--- a/RegressionTest/test_depthmaprunner.py
+++ b/RegressionTest/test/test_depthmaprunner.py
@@ -1,4 +1,6 @@
-import depthmaprunner
+from context import depthmaprunner
+
+import cmdlinewrapper
from cmdlinewrapper import DepthmapCmd
import unittest
from disposablefile import DisposableFile, DisposableDirectory
@@ -15,7 +17,7 @@ def test_binaryDiff(self):
self.assertFalse(depthmaprunner.diffBinaryFiles(f1.filename(), f2.filename()))
-
+
class DepthmapRunnerTest(unittest.TestCase):
def runfunc(self, rundir, args):
@@ -44,17 +46,27 @@ def getOutfile(self, args):
break
self.assertFalse( outputfile == None )
return outputfile
-
+
+ def getTimingsFile(self,args):
+ timingsFile = None
+ for i in range(0, len(args)):
+ if args[i] == "-t" and i < len(args):
+ timingsFile = args[i+1]
+ break
+ return timingsFile
+
def runfuncSucceedAlwaysSame(self, rundir, args):
- os.makedirs(rundir)
outpath = os.path.join(rundir, self.getOutfile(args))
with open (outpath, "w") as f:
f.write("123")
+ timingsFile = self.getTimingsFile(args)
+ if timingsFile:
+ with open (os.path.join(rundir, timingsFile), "w") as f:
+ f.write('"action","duration"\n')
return (True, "")
def runfuncDifferentResults(self, rundir, args):
- os.makedirs(rundir)
outpath = os.path.join(rundir, self.getOutfile(args))
with open (outpath, "w") as f:
f.write(self.__outContent)
@@ -62,7 +74,6 @@ def runfuncDifferentResults(self, rundir, args):
return (True, "")
def runfuncWriteNoFile(self, rundir, args, dontWriteFor):
- os.makedirs(rundir)
if not args[0] == dontWriteFor:
outpath = os.path.join(rundir, self.getOutfile(args))
with open (outpath, "w") as f:
@@ -70,7 +81,6 @@ def runfuncWriteNoFile(self, rundir, args, dontWriteFor):
return (True, "")
def runfuncFail(self, rundir, args, failFor, shouldOtherRun):
- os.makedirs(rundir)
if args[0] == failFor:
return (False, "Boom!")
if shouldOtherRun:
@@ -82,48 +92,55 @@ def runfuncFail(self, rundir, args, failFor, shouldOtherRun):
self.assertFail("Should not have been called for " + args[0])
+ def makeCommand(self, infile, outfile, mode):
+ cmd = cmdlinewrapper.DepthmapCmd()
+ cmd.infile = infile
+ cmd.outfile = outfile
+ cmd.mode = mode
+ return [cmd]
+
def testSuccessfullRun(self):
with DisposableDirectory("testdir", True) as dir:
runner = depthmaprunner.DepthmapRegressionRunner(lambda d, a: self.runfuncSucceedAlwaysSame(d,a), "basebin", "testbin", dir.name())
- (result, message) = runner.runTestCase("testname", "infile.graph", "outfile.graph", "visibility")
+ (result, message) = runner.runTestCase("testname", self.makeCommand("infile.graph", "outfile.graph", "visibility"))
self.assertTrue(result)
def testRunWithDiff(self):
self.__outContent = "abc"
with DisposableDirectory("testdir", True) as dir:
runner = depthmaprunner.DepthmapRegressionRunner(lambda d, a: self.runfuncDifferentResults(d,a), "basebin", "testbin", dir.name())
- (result, message) = runner.runTestCase("testname", "infile.graph", "outfile.graph", "visibility")
+ (result, message) = runner.runTestCase("testname", self.makeCommand("infile.graph", "outfile.graph", "visibility"))
self.assertFalse(result)
self.assertEqual(message, "Test outputs differ")
def testBaseRunOutputMissing(self):
with DisposableDirectory("testdir", True) as dir:
runner = depthmaprunner.DepthmapRegressionRunner(lambda d, a: self.runfuncWriteNoFile(d,a, "basebin"), "basebin", "testbin", dir.name())
- (result, message) = runner.runTestCase("testname", "infile.graph", "outfile.graph", "visibility")
+ (result, message) = runner.runTestCase("testname", self.makeCommand("infile.graph", "outfile.graph", "visibility"))
self.assertFalse(result)
self.assertEqual(message, "Baseline output {0} does not exist".format(os.path.join(dir.name(), "testname" + "_base", "outfile.graph")))
def testTestRunOutputMissing(self):
with DisposableDirectory("testdir", True) as dir:
runner = depthmaprunner.DepthmapRegressionRunner(lambda d, a: self.runfuncWriteNoFile(d,a, "testbin"), "basebin", "testbin", dir.name())
- (result, message) = runner.runTestCase("testname", "infile.graph", "outfile.graph", "visibility")
+ (result, message) = runner.runTestCase("testname", self.makeCommand("infile.graph", "outfile.graph", "visibility"))
self.assertFalse(result)
self.assertEqual(message, "Test output {0} does not exist".format(os.path.join(dir.name(), "testname" + "_test", "outfile.graph")))
def testBaseRunFail(self):
with DisposableDirectory("testdir", True) as dir:
runner = depthmaprunner.DepthmapRegressionRunner(lambda d, a: self.runfuncFail(d,a, "basebin", False), "basebin", "testbin", dir.name())
- (result, message) = runner.runTestCase("testname", "infile.graph", "outfile.graph", "visibility")
+ (result, message) = runner.runTestCase("testname", self.makeCommand("infile.graph", "outfile.graph", "visibility"))
self.assertFalse(result)
- self.assertEqual(message, "Baseline run failed")
+ self.assertEqual(message, "Baseline run failed at step: 0")
def testTestRunFail(self):
with DisposableDirectory("testdir", True) as dir:
runner = depthmaprunner.DepthmapRegressionRunner(lambda d, a: self.runfuncFail(d,a, "testbin", True), "basebin", "testbin", dir.name())
- (result, message) = runner.runTestCase("testname", "infile.graph", "outfile.graph", "visibility")
+ (result, message) = runner.runTestCase("testname", self.makeCommand("infile.graph", "outfile.graph", "visibility"))
self.assertFalse(result)
- self.assertEqual(message, "Test run failed")
+ self.assertEqual(message, "Test run failed at step: 0")
if __name__=="__main__":
diff --git a/RegressionTest/test_disposablefile.py b/RegressionTest/test/test_disposablefile.py
similarity index 100%
rename from RegressionTest/test_disposablefile.py
rename to RegressionTest/test/test_disposablefile.py
diff --git a/RegressionTest/test_main.py b/RegressionTest/test/test_main.py
similarity index 100%
rename from RegressionTest/test_main.py
rename to RegressionTest/test/test_main.py
diff --git a/RegressionTest/test/test_performanceregressionconfig.py b/RegressionTest/test/test_performanceregressionconfig.py
new file mode 100644
index 00000000..fa4d1268
--- /dev/null
+++ b/RegressionTest/test/test_performanceregressionconfig.py
@@ -0,0 +1,43 @@
+import unittest
+from context import performanceregressionconfig
+import disposablefile
+
+
+class TestDisabledConfig(unittest.TestCase):
+ def test_missingConfig(self):
+ p = performanceregressionconfig.PerformanceRegressionConfig(None)
+ self.assertFalse(p.enabled)
+
+ def test_disabledConfig(self):
+ p = performanceregressionconfig.PerformanceRegressionConfig({"enabled": "0"})
+ self.assertFalse(p.enabled)
+
+ p = performanceregressionconfig.PerformanceRegressionConfig({"enabled": "False"})
+ self.assertFalse(p.enabled)
+
+ p = performanceregressionconfig.PerformanceRegressionConfig({"enabled": "True"})
+ self.assertTrue(p.enabled)
+
+class TestSuccessfulConfig(unittest.TestCase):
+ def test_defaultValues(self):
+ p = performanceregressionconfig.PerformanceRegressionConfig({})
+ self.assertTrue(p.enabled)
+ self.assertEqual(p.runsPerInstance, 3)
+ self.assertEqual(p.relativeThresholdInPercent, 1)
+ self.assertEqual(p.absoluteThresholdInSeconds, 1)
+
+ def test_overrideValues(self):
+ p = performanceregressionconfig.PerformanceRegressionConfig(
+ { "runsPerInstance": "5",
+ "relativeThresholdInPercent": 1.5,
+ "absoluteThresholdInSeconds": "4.1"
+ })
+ self.assertTrue(p.enabled)
+ self.assertEqual(p.runsPerInstance, 5)
+ self.assertEqual(p.relativeThresholdInPercent, 1.5)
+ self.assertEqual(p.absoluteThresholdInSeconds, 4.1)
+
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/RegressionTest/test/test_performancerunner.py b/RegressionTest/test/test_performancerunner.py
new file mode 100644
index 00000000..b37495d7
--- /dev/null
+++ b/RegressionTest/test/test_performancerunner.py
@@ -0,0 +1,122 @@
+import csv
+
+import os
+import unittest
+from disposablefile import DisposableFile, DisposableDirectory
+from context import performancerunner
+from context import performanceregressionconfig
+
+import test_depthmaprunner
+
+
+class PerformanceCheckTest(unittest.TestCase):
+ def test_filesMissing(self):
+ message = performancerunner.checkPerformance("f1.csv", "f2.csv", 1, 2)
+ self.assertEqual(message, "Base performance timing file f1.csv is missing")
+
+ with DisposableFile("f1.csv") as f1:
+ with open(f1.filename(), "w") as f:
+ f.write("action,average\n")
+ message = performancerunner.checkPerformance("f1.csv", "f2.csv",1 ,2)
+ self.assertEqual(message, "Test performance timing file f2.csv is missing")
+
+ with DisposableFile("f2.csv") as f2:
+ with open(f2.filename(), "w") as f:
+ f.write("action,average\n")
+ message = performancerunner.checkPerformance("f1.csv", "f2.csv", 1, 2)
+ self.assertEqual(message, "Base performance timing file f1.csv is missing")
+
+ def test_fileLineNumberMismatch(self):
+ with DisposableFile("f1.csv") as f1, DisposableFile("f2.csv") as f2:
+ with open(f1.filename(), "w") as f:
+ f.write("action,average\nfoo,10\n")
+ with open(f2.filename(), "w") as f:
+ f.write("action,average\n")
+ message = performancerunner.checkPerformance("f1.csv", "f2.csv", 1, 2)
+ self.assertEqual(message, "baseline performance file f1.csv has more lines than the test one f2.csv")
+
+ with DisposableFile("f1.csv") as f1, DisposableFile("f2.csv") as f2:
+ with open(f1.filename(), "w") as f:
+ f.write("action,average\nfoo,10\n")
+ with open(f2.filename(), "w") as f:
+ f.write("action,average\nfoo,10\nbar,20\n")
+ message = performancerunner.checkPerformance("f1.csv", "f2.csv", 1 , 2)
+ self.assertEqual(message, "baseline performance file f1.csv has fewer lines than the test one f2.csv")
+
+ def test_fileLabelMismatch(self):
+ with DisposableFile("f1.csv") as f1, DisposableFile("f2.csv") as f2:
+ with open(f1.filename(), "w") as f:
+ f.write("action,average\nfoo,10\n")
+ with open(f2.filename(), "w") as f:
+ f.write("action,average\nbar,10\n")
+ message = performancerunner.checkPerformance("f1.csv", "f2.csv", 1, 2)
+ self.assertEqual(message, "performance line mismatch: base 'foo', test 'bar'")
+
+ def test_successfulRunEmptyFile(self):
+ with DisposableFile("f1.csv") as f1, DisposableFile("f2.csv") as f2:
+ with open(f1.filename(), "w") as f:
+ f.write("action,average\n")
+ with open(f2.filename(), "w") as f:
+ f.write("action,average\n")
+ message = performancerunner.checkPerformance("f1.csv", "f2.csv", 1, 2)
+ self.assertEqual(message, "")
+
+ def test_successfulRun(self):
+ with DisposableFile("f1.csv") as f1, DisposableFile("f2.csv") as f2:
+ with open(f1.filename(), "w") as f:
+ f.write("action,average\nfoo,10\nbar,21\nbaz,1000\nblub,10\n")
+ with open(f2.filename(), "w") as f:
+ f.write("action,average\nfoo,10.9\nbar,10\nbaz,1010\nblub,10\n")
+ message = performancerunner.checkPerformance("f1.csv", "f2.csv", 1, 2)
+ self.assertEqual(message, "")
+
+ def test_performanceRegression(self):
+ with DisposableFile("f1.csv") as f1, DisposableFile("f2.csv") as f2:
+ with open(f1.filename(), "w") as f:
+ f.write("action,average\nfoo,10\n")
+ with open(f2.filename(), "w") as f:
+ f.write("action,average\nfoo,18\n")
+ message = performancerunner.checkPerformance("f1.csv", "f2.csv", 1, 2)
+ self.assertEqual(message, "Performance regression: foo took 18s instead of 10s")
+
+class test_PerformanceAggregation(unittest.TestCase):
+ def test_aggregation(self):
+ with DisposableDirectory("testdir") as d:
+ os.makedirs(d.name())
+ nameTemplate = "test{0}{1}.csv"
+ with open(os.path.join(d.name(), nameTemplate.format(0,0)), "w") as f:
+ f.write("action,duration\nt1,3\nt2,2\n")
+ with open(os.path.join(d.name(), nameTemplate.format(1,0)), "w") as f:
+ f.write("action,duration\nt1,1.5\nt2,2.5\n")
+ with open(os.path.join(d.name(), nameTemplate.format(2,0)), "w") as f:
+ f.write("action,duration\nt1,2\nt2,1.5\n")
+
+ resFile = performancerunner.aggregatePerformanceStats(d.name(), 3, 1, nameTemplate)
+ with open(resFile, "r") as f:
+ reader = csv.DictReader(f)
+ line = next(reader)
+ self.assertEqual(line["action"], "t1")
+ self.assertEqual(float(line["max"]), 3 )
+ self.assertEqual(float(line["min"]), 1.5)
+ self.assertEqual(float(line["average"]), 6.5/3)
+
+ line = next(reader)
+ self.assertEqual(line["action"], "t2")
+ self.assertEqual(float(line["max"]), 2.5 )
+ self.assertEqual(float(line["min"]), 1.5)
+ self.assertEqual(float(line["average"]), 2)
+
+ line = next(reader)
+ self.assertEqual(line["action"], "total")
+ self.assertEqual(float(line["max"]), 5 )
+ self.assertEqual(float(line["min"]), 3.5)
+ self.assertEqual(float(line["average"]), 12.5/3)
+
+class test_PerformanceRunner(test_depthmaprunner.DepthmapRegressioRunnerTest):
+ def testSuccessfullRun(self):
+ with DisposableDirectory("testdir", True) as testDir, DisposableDirectory("basedir") as baseDir:
+ conf = performanceregressionconfig.PerformanceRegressionConfig({})
+ runner = performancerunner.PerformanceRunner(lambda d, a: self.runfuncSucceedAlwaysSame(d,a), "basebin", "testbin", testDir.name(), conf)
+ (result, message) = runner.runTestCase("testname", self.makeCommand("infile.graph", "outfile.graph","visibility"))
+ self.assertTrue(result)
+
diff --git a/RegressionTest/test_runhelpers.py b/RegressionTest/test/test_runhelpers.py
similarity index 95%
rename from RegressionTest/test_runhelpers.py
rename to RegressionTest/test/test_runhelpers.py
index c3da70f4..1d116ce7 100644
--- a/RegressionTest/test_runhelpers.py
+++ b/RegressionTest/test/test_runhelpers.py
@@ -1,5 +1,5 @@
import unittest
-import runhelpers
+from context import runhelpers
from disposablefile import DisposableDirectory
import os
import platform
@@ -49,12 +49,14 @@ def test_runExecutable(self):
def test_runExecutableFail(self):
with DisposableDirectory("testdir") as d:
+ runhelpers.prepareDirectory(d.name())
retcode, output = runhelpers.runExecutable( d.name(), [sys.executable, "-c", "exit(-1)"])
self.assertFalse(retcode)
self.assertEqual(output, "")
def test_runExecutableException(self):
with DisposableDirectory("testdir") as d:
+ runhelpers.prepareDirectory(d.name())
retcode, output = runhelpers.runExecutable( d.name(), [sys.executable, "-c", "raise Exception()"])
self.assertFalse(retcode)
self.assertEqual(output, 'Traceback (most recent call last):\n File "", line 1, in \nException\n')
diff --git a/RegressionTest/test_test_main.py b/RegressionTest/test/test_test_main.py
similarity index 96%
rename from RegressionTest/test_test_main.py
rename to RegressionTest/test/test_test_main.py
index b931a373..628d42a1 100644
--- a/RegressionTest/test_test_main.py
+++ b/RegressionTest/test/test_test_main.py
@@ -1,6 +1,6 @@
import unittest
from disposablefile import DisposableDirectory
-import runhelpers
+from context import runhelpers
import sys
class TestUnitTestMain(unittest.TestCase):
diff --git a/RegressionTest/test_config.py b/RegressionTest/test_config.py
deleted file mode 100644
index b6a757ca..00000000
--- a/RegressionTest/test_config.py
+++ /dev/null
@@ -1,64 +0,0 @@
-import unittest
-import config
-from disposablefile import DisposableFile
-import RegressionTestRunner
-
-def writeConfig(filename, rundir):
- with open(filename, "w") as f:
- f.write('{ "rundir": "'+ rundir +'",\n')
- f.write(' "basebinlocation": "../baselineBinaries",\n')
- f.write(' "testbinlocation": "../..",\n')
- f.write(' "testcases": {\n')
- f.write(' "test1": {\n')
- f.write(' "infile": "infile.graph",\n')
- f.write(' "outfile": "outfile.graph",\n')
- f.write(' "mode": "VGA",\n')
- f.write(' "subcmds": {\n')
- f.write(' "Visibility": {\n')
- f.write(' "visibilityMode": "metric",\n')
- f.write(' "radius": "7"}}}}}')
-
-
-
-class TestMethods(unittest.TestCase):
- def test_buildCmd(self):
- data = { "infile": "foo.graph", "outfile": "bar.graph", "mode": "VGA", "subcmds": { "Visibility" : {"visibilityMode": "visibility", "globalMeasures": "1", "radius": "5"}}}
- cmd = config.buildCmd( data )
- self.assertEqual(cmd.infile, "foo.graph")
- self.assertEqual(cmd.outfile, "bar.graph")
- self.assertEqual(cmd.mode, "VGA")
- self.assertEqual(len(cmd.modeLines), 1)
-
-
- def test_buildSubCmd(self):
- data = { "visibilityMode": "visibility", "globalMeasures": "1", "radius": "5"}
- cmd = config.buildSubCmd("Visibility", data)
- self.assertEqual(cmd.visibilityMode, "visibility")
- self.assertTrue(cmd.globalMeasures)
- self.assertFalse(cmd.localMeasures)
- self.assertEqual(cmd.radius, "5")
-
-
- def test_buildSubCmdInvalid(self):
- data = { "visibilityMode": "visibility", "globalMeasures": "1", "radius": "5"}
- with self.assertRaises(config.ConfigError) as cm:
- config.buildSubCmd("foobar", data)
- self.assertEqual(cm.exception.message, "Unknown sub commandline config foobar")
-
- def test_configClass(self):
- with DisposableFile("test.config") as testfile:
- writeConfig(testfile.filename(), "../foo/bar")
- conf = config.RegressionConfig(testfile.filename())
- self.assertEqual(len(conf.testcases), 1)
- self.assertEqual(conf.rundir, "../foo/bar")
- self.assertTrue("test1" in conf.testcases)
-
-
-class TestRealConfig(unittest.TestCase):
- def test_realConfig(self):
- configFile = RegressionTestRunner.defaultConfigFile
- self.assertNotEqual( configFile, "" )
- conf = config.RegressionConfig(configFile)
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/ThirdParty/FakeIt/Catch/fakeit.hpp b/ThirdParty/FakeIt/Catch/fakeit.hpp
new file mode 100644
index 00000000..81ad3c14
--- /dev/null
+++ b/ThirdParty/FakeIt/Catch/fakeit.hpp
@@ -0,0 +1,9300 @@
+#pragma once
+/*
+ * FakeIt - A Simplified C++ Mocking Framework
+ * Copyright (c) Eran Pe'er 2013
+ * Generated: 2017-05-07 09:27:02.651812
+ * Distributed under the MIT License. Please refer to the LICENSE file at:
+ * https://github.com/eranpeer/FakeIt
+ */
+
+#ifndef fakeit_h__
+#define fakeit_h__
+
+
+
+#include
+#include
+#include
+#include
+#include
+#if defined (__GNUG__) || _MSC_VER >= 1900
+#define THROWS noexcept(false)
+#define NO_THROWS noexcept(true)
+#elif defined (_MSC_VER)
+#define THROWS throw(...)
+#define NO_THROWS
+#endif
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+namespace fakeit {
+
+ template
+ struct naked_type {
+ typedef typename std::remove_cv::type>::type type;
+ };
+
+ template< class T > struct tuple_arg { typedef T type; };
+ template< class T > struct tuple_arg < T& > { typedef T& type; };
+ template< class T > struct tuple_arg < T&& > { typedef T&& type; };
+
+
+
+
+ template
+ using ArgumentsTuple = std::tuple < arglist... > ;
+
+ template< class T > struct test_arg { typedef T& type; };
+ template< class T > struct test_arg< T& > { typedef T& type; };
+ template< class T > struct test_arg< T&& > { typedef T& type; };
+
+ template< class T > struct production_arg { typedef T& type; };
+ template< class T > struct production_arg< T& > { typedef T& type; };
+ template< class T > struct production_arg< T&& > { typedef T&& type; };
+
+ template
+ class is_ostreamable {
+ struct no {};
+#if defined(_MSC_VER) && _MSC_VER < 1900
+ template
+ static decltype(operator<<(std::declval(), std::declval())) test(std::ostream &s, const T1 &t);
+#else
+ template
+ static auto test(std::ostream &s, const T1 &t) -> decltype(s << t);
+#endif
+ static no test(...);
+ public:
+
+ static const bool value =
+ std::is_arithmetic::value ||
+ std::is_pointer::value ||
+ std::is_same())), std::ostream &>::value;
+ };
+
+
+ template <>
+ class is_ostreamable {
+ public:
+ static const bool value = true;
+ };
+
+ template
+ class is_ostreamable& (*)(std::basic_ios&)> {
+ public:
+ static const bool value = true;
+ };
+
+ template
+ class is_ostreamable& (*)(std::basic_ostream&)> {
+ public:
+ static const bool value = true;
+ };
+
+ template
+ struct VTableMethodType {
+#if defined (__GNUG__)
+ typedef R(*type)(void *, arglist...);
+#elif defined (_MSC_VER)
+ typedef R(__thiscall *type)(void *, arglist...);
+#endif
+ };
+}
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace fakeit {
+
+ struct FakeitContext;
+
+ template
+ struct MockObject {
+ virtual ~MockObject() THROWS { };
+
+ virtual C &get() = 0;
+
+ virtual FakeitContext &getFakeIt() = 0;
+ };
+
+ struct MethodInfo {
+
+ static unsigned int nextMethodOrdinal() {
+ static std::atomic_uint ordinal{0};
+ return ++ordinal;
+ }
+
+ MethodInfo(unsigned int anId, std::string aName) :
+ _id(anId), _name(aName) { }
+
+ unsigned int id() const {
+ return _id;
+ }
+
+ std::string name() const {
+ return _name;
+ }
+
+ void setName(const std::string &value) {
+ _name = value;
+ }
+
+ private:
+ unsigned int _id;
+ std::string _name;
+ };
+
+ struct UnknownMethod {
+
+ static MethodInfo &instance() {
+ static MethodInfo instance(MethodInfo::nextMethodOrdinal(), "unknown");
+ return instance;
+ }
+
+ };
+
+}
+namespace fakeit {
+ class Destructible {
+ public:
+ virtual ~Destructible() {}
+ };
+}
+
+namespace fakeit {
+
+ struct Invocation : Destructible {
+
+ static unsigned int nextInvocationOrdinal() {
+ static std::atomic_uint invocationOrdinal{0};
+ return ++invocationOrdinal;
+ }
+
+ struct Matcher {
+
+ virtual ~Matcher() THROWS {
+ }
+
+ virtual bool matches(Invocation &invocation) = 0;
+
+ virtual std::string format() const = 0;
+ };
+
+ Invocation(unsigned int ordinal, MethodInfo &method) :
+ _ordinal(ordinal), _method(method), _isVerified(false) {
+ }
+
+ virtual ~Invocation() override = default;
+
+ unsigned int getOrdinal() const {
+ return _ordinal;
+ }
+
+ MethodInfo &getMethod() const {
+ return _method;
+ }
+
+ void markAsVerified() {
+ _isVerified = true;
+ }
+
+ bool isVerified() const {
+ return _isVerified;
+ }
+
+ virtual std::string format() const = 0;
+
+ private:
+ const unsigned int _ordinal;
+ MethodInfo &_method;
+ bool _isVerified;
+ };
+
+}
+#include
+#include
+#include
+#include
+#include
+
+namespace fakeit {
+
+ template
+ struct Formatter;
+
+ template <>
+ struct Formatter
+ {
+ static std::string format(bool const &val)
+ {
+ return val ? "true" : "false";
+ }
+ };
+
+ template <>
+ struct Formatter
+ {
+ static std::string format(char const &val)
+ {
+ std::string s;
+ s += "'";
+ s += val;
+ s += "'";
+ return s;
+ }
+ };
+
+ template
+ struct Formatter::value>::type> {
+ static std::string format(C const &)
+ {
+ return "?";
+ }
+ };
+
+ template
+ struct Formatter::value>::type> {
+ static std::string format(C const &val)
+ {
+ std::ostringstream os;
+ os << val;
+ return os.str();
+ }
+ };
+
+
+ template
+ using TypeFormatter = Formatter::type>;
+}
+
+namespace fakeit {
+
+
+ template
+ struct TuplePrinter {
+ static void print(std::ostream &strm, const Tuple &t) {
+ TuplePrinter::print(strm, t);
+ strm << ", " << fakeit::TypeFormatter(t))>::format(std::get(t));
+ }
+ };
+
+ template
+ struct TuplePrinter {
+ static void print(std::ostream &strm, const Tuple &t) {
+ strm << fakeit::TypeFormatter(t))>::format(std::get<0>(t));
+ }
+ };
+
+ template
+ struct TuplePrinter {
+ static void print(std::ostream &, const Tuple &) {
+ }
+ };
+
+ template
+ void print(std::ostream &strm, const std::tuple &t) {
+ strm << "(";
+ TuplePrinter::print(strm, t);
+ strm << ")";
+ }
+
+ template
+ std::ostream &operator<<(std::ostream &strm, const std::tuple &t) {
+ print(strm, t);
+ return strm;
+ }
+
+}
+
+
+namespace fakeit {
+
+ template
+ struct ActualInvocation : public Invocation {
+
+ struct Matcher : public virtual Destructible {
+ virtual bool matches(ActualInvocation &actualInvocation) = 0;
+
+ virtual std::string format() const = 0;
+ };
+
+ ActualInvocation(unsigned int ordinal, MethodInfo &method, const typename fakeit::production_arg::type... args) :
+ Invocation(ordinal, method), _matcher{ nullptr }
+ , actualArguments{ std::forward(args)... }
+ {
+ }
+
+ ArgumentsTuple & getActualArguments() {
+ return actualArguments;
+ }
+
+
+ void setActualMatcher(Matcher *matcher) {
+ this->_matcher = matcher;
+ }
+
+ Matcher *getActualMatcher() {
+ return _matcher;
+ }
+
+ virtual std::string format() const override {
+ std::ostringstream out;
+ out << getMethod().name();
+ print(out, actualArguments);
+ return out.str();
+ }
+
+ private:
+
+ Matcher *_matcher;
+ ArgumentsTuple actualArguments;
+ };
+
+ template
+ std::ostream &operator<<(std::ostream &strm, const ActualInvocation &ai) {
+ strm << ai.format();
+ return strm;
+ }
+
+}
+
+
+
+
+
+#include
+
+namespace fakeit {
+
+ struct ActualInvocationsContainer {
+ virtual void clear() = 0;
+
+ virtual ~ActualInvocationsContainer() NO_THROWS { }
+ };
+
+ struct ActualInvocationsSource {
+ virtual void getActualInvocations(std::unordered_set &into) const = 0;
+
+ virtual ~ActualInvocationsSource() NO_THROWS { }
+ };
+
+ struct InvocationsSourceProxy : public ActualInvocationsSource {
+
+ InvocationsSourceProxy(ActualInvocationsSource *inner) :
+ _inner(inner) {
+ }
+
+ void getActualInvocations(std::unordered_set &into) const override {
+ _inner->getActualInvocations(into);
+ }
+
+ private:
+ std::shared_ptr _inner;
+ };
+
+ struct UnverifiedInvocationsSource : public ActualInvocationsSource {
+
+ UnverifiedInvocationsSource(InvocationsSourceProxy decorated) : _decorated(decorated) {
+ }
+
+ void getActualInvocations(std::unordered_set &into) const override {
+ std::unordered_set all;
+ _decorated.getActualInvocations(all);
+ for (fakeit::Invocation *i : all) {
+ if (!i->isVerified()) {
+ into.insert(i);
+ }
+ }
+ }
+
+ private:
+ InvocationsSourceProxy _decorated;
+ };
+
+ struct AggregateInvocationsSource : public ActualInvocationsSource {
+
+ AggregateInvocationsSource(std::vector &sources) : _sources(sources) {
+ }
+
+ void getActualInvocations(std::unordered_set &into) const override {
+ std::unordered_set tmp;
+ for (ActualInvocationsSource *source : _sources) {
+ source->getActualInvocations(tmp);
+ }
+ filter(tmp, into);
+ }
+
+ protected:
+ bool shouldInclude(fakeit::Invocation *) const {
+ return true;
+ }
+
+ private:
+ std::vector _sources;
+
+ void filter(std::unordered_set &source, std::unordered_set &target) const {
+ for (Invocation *i:source) {
+ if (shouldInclude(i)) {
+ target.insert(i);
+ }
+ }
+ }
+ };
+}
+
+namespace fakeit {
+
+ class Sequence {
+ private:
+
+ protected:
+
+ Sequence() {
+ }
+
+ virtual ~Sequence() THROWS {
+ }
+
+ public:
+
+
+ virtual void getExpectedSequence(std::vector &into) const = 0;
+
+
+ virtual void getInvolvedMocks(std::vector &into) const = 0;
+
+ virtual unsigned int size() const = 0;
+
+ friend class VerifyFunctor;
+ };
+
+ class ConcatenatedSequence : public virtual Sequence {
+ private:
+ const Sequence &s1;
+ const Sequence &s2;
+
+ protected:
+ ConcatenatedSequence(const Sequence &seq1, const Sequence &seq2) :
+ s1(seq1), s2(seq2) {
+ }
+
+ public:
+
+ virtual ~ConcatenatedSequence() {
+ }
+
+ unsigned int size() const override {
+ return s1.size() + s2.size();
+ }
+
+ const Sequence &getLeft() const {
+ return s1;
+ }
+
+ const Sequence &getRight() const {
+ return s2;
+ }
+
+ void getExpectedSequence(std::vector &into) const override {
+ s1.getExpectedSequence(into);
+ s2.getExpectedSequence(into);
+ }
+
+ virtual void getInvolvedMocks(std::vector &into) const override {
+ s1.getInvolvedMocks(into);
+ s2.getInvolvedMocks(into);
+ }
+
+ friend inline ConcatenatedSequence operator+(const Sequence &s1, const Sequence &s2);
+ };
+
+ class RepeatedSequence : public virtual Sequence {
+ private:
+ const Sequence &_s;
+ const int times;
+
+ protected:
+ RepeatedSequence(const Sequence &s, const int t) :
+ _s(s), times(t) {
+ }
+
+ public:
+
+ ~RepeatedSequence() {
+ }
+
+ unsigned int size() const override {
+ return _s.size() * times;
+ }
+
+ friend inline RepeatedSequence operator*(const Sequence &s, int times);
+
+ friend inline RepeatedSequence operator*(int times, const Sequence &s);
+
+ void getInvolvedMocks(std::vector &into) const override {
+ _s.getInvolvedMocks(into);
+ }
+
+ void getExpectedSequence(std::vector &into) const override {
+ for (int i = 0; i < times; i++)
+ _s.getExpectedSequence(into);
+ }
+
+ int getTimes() const {
+ return times;
+ }
+
+ const Sequence &getSequence() const {
+ return _s;
+ }
+ };
+
+ inline ConcatenatedSequence operator+(const Sequence &s1, const Sequence &s2) {
+ return ConcatenatedSequence(s1, s2);
+ }
+
+ inline RepeatedSequence operator*(const Sequence &s, int times) {
+ if (times <= 0)
+ throw std::invalid_argument("times");
+ return RepeatedSequence(s, times);
+ }
+
+ inline RepeatedSequence operator*(int times, const Sequence &s) {
+ if (times <= 0)
+ throw std::invalid_argument("times");
+ return RepeatedSequence(s, times);
+ }
+
+}
+
+namespace fakeit {
+
+ enum class VerificationType {
+ Exact, AtLeast, NoMoreInvocations
+ };
+
+ enum class UnexpectedType {
+ Unmocked, Unmatched
+ };
+
+ struct VerificationEvent {
+
+ VerificationEvent(VerificationType aVerificationType) :
+ _verificationType(aVerificationType), _line(0) {
+ }
+
+ virtual ~VerificationEvent() = default;
+
+ VerificationType verificationType() const {
+ return _verificationType;
+ }
+
+ void setFileInfo(const char * aFile, int aLine, const char * aCallingMethod) {
+ _file = aFile;
+ _callingMethod = aCallingMethod;
+ _line = aLine;
+ }
+
+ const char * file() const {
+ return _file;
+ }
+
+ int line() const {
+ return _line;
+ }
+
+ const char * callingMethod() const {
+ return _callingMethod;
+ }
+
+ private:
+ VerificationType _verificationType;
+ const char * _file;
+ int _line;
+ const char * _callingMethod;
+ };
+
+ struct NoMoreInvocationsVerificationEvent : public VerificationEvent {
+
+ ~NoMoreInvocationsVerificationEvent() = default;
+
+ NoMoreInvocationsVerificationEvent(
+ std::vector &allTheIvocations,
+ std::vector &anUnverifedIvocations) :
+ VerificationEvent(VerificationType::NoMoreInvocations),
+ _allIvocations(allTheIvocations),
+ _unverifedIvocations(anUnverifedIvocations) {
+ }
+
+ const std::vector &allIvocations() const {
+ return _allIvocations;
+ }
+
+ const std::vector &unverifedIvocations() const {
+ return _unverifedIvocations;
+ }
+
+ private:
+ const std::vector _allIvocations;
+ const std::vector _unverifedIvocations;
+ };
+
+ struct SequenceVerificationEvent : public VerificationEvent {
+
+ ~SequenceVerificationEvent() = default;
+
+ SequenceVerificationEvent(VerificationType aVerificationType,
+ std::vector &anExpectedPattern,
+ std::vector &anActualSequence,
+ int anExpectedCount,
+ int anActualCount) :
+ VerificationEvent(aVerificationType),
+ _expectedPattern(anExpectedPattern),
+ _actualSequence(anActualSequence),
+ _expectedCount(anExpectedCount),
+ _actualCount(anActualCount)
+ {
+ }
+
+ const std::vector &expectedPattern() const {
+ return _expectedPattern;
+ }
+
+ const std::vector &actualSequence() const {
+ return _actualSequence;
+ }
+
+ int expectedCount() const {
+ return _expectedCount;
+ }
+
+ int actualCount() const {
+ return _actualCount;
+ }
+
+ private:
+ const std::vector _expectedPattern;
+ const std::vector _actualSequence;
+ const int _expectedCount;
+ const int _actualCount;
+ };
+
+ struct UnexpectedMethodCallEvent {
+ UnexpectedMethodCallEvent(UnexpectedType unexpectedType, const Invocation &invocation) :
+ _unexpectedType(unexpectedType), _invocation(invocation) {
+ }
+
+ const Invocation &getInvocation() const {
+ return _invocation;
+ }
+
+ UnexpectedType getUnexpectedType() const {
+ return _unexpectedType;
+ }
+
+ const UnexpectedType _unexpectedType;
+ const Invocation &_invocation;
+ };
+
+}
+
+namespace fakeit {
+
+ struct VerificationEventHandler {
+ virtual void handle(const SequenceVerificationEvent &e) = 0;
+
+ virtual void handle(const NoMoreInvocationsVerificationEvent &e) = 0;
+ };
+
+ struct EventHandler : public VerificationEventHandler {
+ using VerificationEventHandler::handle;
+
+ virtual void handle(const UnexpectedMethodCallEvent &e) = 0;
+ };
+
+}
+#include
+#include
+
+namespace fakeit {
+
+ struct UnexpectedMethodCallEvent;
+ struct SequenceVerificationEvent;
+ struct NoMoreInvocationsVerificationEvent;
+
+ struct EventFormatter {
+
+ virtual std::string format(const fakeit::UnexpectedMethodCallEvent &e) = 0;
+
+ virtual std::string format(const fakeit::SequenceVerificationEvent &e) = 0;
+
+ virtual std::string format(const fakeit::NoMoreInvocationsVerificationEvent &e) = 0;
+
+ };
+
+}
+
+namespace fakeit {
+
+ struct FakeitContext : public EventHandler, protected EventFormatter {
+
+ virtual ~FakeitContext() = default;
+
+ void handle(const UnexpectedMethodCallEvent &e) override {
+ fireEvent(e);
+ auto &eh = getTestingFrameworkAdapter();
+ eh.handle(e);
+ }
+
+ void handle(const SequenceVerificationEvent &e) override {
+ fireEvent(e);
+ auto &eh = getTestingFrameworkAdapter();
+ return eh.handle(e);
+ }
+
+ void handle(const NoMoreInvocationsVerificationEvent &e) override {
+ fireEvent(e);
+ auto &eh = getTestingFrameworkAdapter();
+ return eh.handle(e);
+ }
+
+ std::string format(const UnexpectedMethodCallEvent &e) override {
+ auto &eventFormatter = getEventFormatter();
+ return eventFormatter.format(e);
+ }
+
+ std::string format(const SequenceVerificationEvent &e) override {
+ auto &eventFormatter = getEventFormatter();
+ return eventFormatter.format(e);
+ }
+
+ std::string format(const NoMoreInvocationsVerificationEvent &e) override {
+ auto &eventFormatter = getEventFormatter();
+ return eventFormatter.format(e);
+ }
+
+ void addEventHandler(EventHandler &eventListener) {
+ _eventListeners.push_back(&eventListener);
+ }
+
+ void clearEventHandlers() {
+ _eventListeners.clear();
+ }
+
+ protected:
+ virtual EventHandler &getTestingFrameworkAdapter() = 0;
+
+ virtual EventFormatter &getEventFormatter() = 0;
+
+ private:
+ std::vector _eventListeners;
+
+ void fireEvent(const NoMoreInvocationsVerificationEvent &evt) {
+ for (auto listener : _eventListeners)
+ listener->handle(evt);
+ }
+
+ void fireEvent(const UnexpectedMethodCallEvent &evt) {
+ for (auto listener : _eventListeners)
+ listener->handle(evt);
+ }
+
+ void fireEvent(const SequenceVerificationEvent &evt) {
+ for (auto listener : _eventListeners)
+ listener->handle(evt);
+ }
+
+ };
+
+}
+#include
+#include
+
+namespace fakeit {
+
+ struct DefaultEventFormatter : public EventFormatter {
+
+ virtual std::string format(const UnexpectedMethodCallEvent &e) override {
+ std::ostringstream out;
+ out << "Unexpected method invocation: ";
+ out << e.getInvocation().format() << std::endl;
+ if (UnexpectedType::Unmatched == e.getUnexpectedType()) {
+ out << " Could not find Any recorded behavior to support this method call.";
+ } else {
+ out << " An unmocked method was invoked. All used virtual methods must be stubbed!";
+ }
+ return out.str();
+ }
+
+
+ virtual std::string format(const SequenceVerificationEvent &e) override {
+ std::ostringstream out;
+ out << "Verification error" << std::endl;
+
+ out << "Expected pattern: ";
+ const std::vector expectedPattern = e.expectedPattern();
+ out << formatExpectedPattern(expectedPattern) << std::endl;
+
+ out << "Expected matches: ";
+ formatExpectedCount(out, e.verificationType(), e.expectedCount());
+ out << std::endl;
+
+ out << "Actual matches : " << e.actualCount() << std::endl;
+
+ auto actualSequence = e.actualSequence();
+ out << "Actual sequence : total of " << actualSequence.size() << " actual invocations";
+ if (actualSequence.size() == 0) {
+ out << ".";
+ } else {
+ out << ":" << std::endl;
+ }
+ formatInvocationList(out, actualSequence);
+
+ return out.str();
+ }
+
+ virtual std::string format(const NoMoreInvocationsVerificationEvent &e) override {
+ std::ostringstream out;
+ out << "Verification error" << std::endl;
+ out << "Expected no more invocations!! But the following unverified invocations were found:" << std::endl;
+ formatInvocationList(out, e.unverifedIvocations());
+ return out.str();
+ }
+
+ private:
+
+ static std::string formatSequence(const Sequence &val) {
+ const ConcatenatedSequence *cs = dynamic_cast(&val);
+ if (cs) {
+ return format(*cs);
+ }
+ const RepeatedSequence *rs = dynamic_cast(&val);
+ if (rs) {
+ return format(*rs);
+ }
+
+
+ std::vector vec;
+ val.getExpectedSequence(vec);
+ return vec[0]->format();
+ }
+
+ static void formatExpectedCount(std::ostream &out, fakeit::VerificationType verificationType,
+ int expectedCount) {
+ if (verificationType == fakeit::VerificationType::Exact)
+ out << "exactly ";
+
+ if (verificationType == fakeit::VerificationType::AtLeast)
+ out << "at least ";
+
+ out << expectedCount;
+ }
+
+ static void formatInvocationList(std::ostream &out, const std::vector &actualSequence) {
+ size_t max_size = actualSequence.size();
+ if (max_size > 5)
+ max_size = 5;
+
+ for (unsigned int i = 0; i < max_size; i++) {
+ out << " ";
+ auto invocation = actualSequence[i];
+ out << invocation->format();
+ if (i < max_size - 1)
+ out << std::endl;
+ }
+
+ if (actualSequence.size() > max_size)
+ out << std::endl << " ...";
+ }
+
+ static std::string format(const ConcatenatedSequence &val) {
+ std::ostringstream out;
+ out << formatSequence(val.getLeft()) << " + " << formatSequence(val.getRight());
+ return out.str();
+ }
+
+ static std::string format(const RepeatedSequence &val) {
+ std::ostringstream out;
+ const ConcatenatedSequence *cs = dynamic_cast(&val.getSequence());
+ const RepeatedSequence *rs = dynamic_cast(&val.getSequence());
+ if (rs || cs)
+ out << '(';
+ out << formatSequence(val.getSequence());
+ if (rs || cs)
+ out << ')';
+
+ out << " * " << val.getTimes();
+ return out.str();
+ }
+
+ static std::string formatExpectedPattern(const std::vector &expectedPattern) {
+ std::string expectedPatternStr;
+ for (unsigned int i = 0; i < expectedPattern.size(); i++) {
+ Sequence *s = expectedPattern[i];
+ expectedPatternStr += formatSequence(*s);
+ if (i < expectedPattern.size() - 1)
+ expectedPatternStr += " ... ";
+ }
+ return expectedPatternStr;
+ }
+ };
+}
+namespace fakeit {
+
+ struct FakeitException {
+ std::exception err;
+
+ virtual ~FakeitException() = default;
+
+ virtual std::string what() const = 0;
+
+ friend std::ostream &operator<<(std::ostream &os, const FakeitException &val) {
+ os << val.what();
+ return os;
+ }
+ };
+
+
+
+
+ struct UnexpectedMethodCallException : public FakeitException {
+
+ UnexpectedMethodCallException(std::string format) :
+ _format(format) {
+ }
+
+ virtual std::string what() const override {
+ return _format;
+ }
+
+ private:
+ std::string _format;
+ };
+
+}
+
+namespace fakeit {
+
+ struct DefaultEventLogger : public fakeit::EventHandler {
+
+ DefaultEventLogger(EventFormatter &formatter) : _formatter(formatter), _out(std::cout) { }
+
+ virtual void handle(const UnexpectedMethodCallEvent &e) override {
+ _out << _formatter.format(e) << std::endl;
+ }
+
+ virtual void handle(const SequenceVerificationEvent &e) override {
+ _out << _formatter.format(e) << std::endl;
+ }
+
+ virtual void handle(const NoMoreInvocationsVerificationEvent &e) override {
+ _out << _formatter.format(e) << std::endl;
+ }
+
+ private:
+ EventFormatter &_formatter;
+ std::ostream &_out;
+ };
+
+}
+
+namespace fakeit {
+
+ class AbstractFakeit : public FakeitContext {
+ public:
+ virtual ~AbstractFakeit() = default;
+
+ protected:
+
+ virtual fakeit::EventHandler &accessTestingFrameworkAdapter() = 0;
+
+ virtual EventFormatter &accessEventFormatter() = 0;
+ };
+
+ class DefaultFakeit : public AbstractFakeit {
+ DefaultEventFormatter _formatter;
+ fakeit::EventFormatter *_customFormatter;
+ fakeit::EventHandler *_testingFrameworkAdapter;
+
+ public:
+
+ DefaultFakeit() : _formatter(),
+ _customFormatter(nullptr),
+ _testingFrameworkAdapter(nullptr) {
+ }
+
+ virtual ~DefaultFakeit() = default;
+
+ void setCustomEventFormatter(fakeit::EventFormatter &customEventFormatter) {
+ _customFormatter = &customEventFormatter;
+ }
+
+ void resetCustomEventFormatter() {
+ _customFormatter = nullptr;
+ }
+
+ void setTestingFrameworkAdapter(fakeit::EventHandler &testingFrameforkAdapter) {
+ _testingFrameworkAdapter = &testingFrameforkAdapter;
+ }
+
+ void resetTestingFrameworkAdapter() {
+ _testingFrameworkAdapter = nullptr;
+ }
+
+ protected:
+
+ fakeit::EventHandler &getTestingFrameworkAdapter() override {
+ if (_testingFrameworkAdapter)
+ return *_testingFrameworkAdapter;
+ return accessTestingFrameworkAdapter();
+ }
+
+ EventFormatter &getEventFormatter() override {
+ if (_customFormatter)
+ return *_customFormatter;
+ return accessEventFormatter();
+ }
+
+ EventFormatter &accessEventFormatter() override {
+ return _formatter;
+ }
+
+ };
+}
+
+namespace fakeit {
+
+ struct VerificationException : public FakeitException {
+ virtual ~VerificationException() = default;
+
+ void setFileInfo(const char *file, int line, const char *callingMethod) {
+ _file = file;
+ _callingMethod = callingMethod;
+ _line = line;
+ }
+
+ const char *file() const {
+ return _file;
+ }
+
+ int line() const {
+ return _line;
+ }
+
+ const char *callingMethod() const {
+ return _callingMethod;
+ }
+
+ private:
+ const char *_file;
+ int _line;
+ const char *_callingMethod;
+ };
+
+ struct NoMoreInvocationsVerificationException : public VerificationException {
+
+ NoMoreInvocationsVerificationException(std::string format) :
+ _format(format) {
+ }
+
+ virtual std::string what() const override {
+ return _format;
+ }
+
+ private:
+ std::string _format;
+ };
+
+ struct SequenceVerificationException : public VerificationException {
+ SequenceVerificationException(const std::string &format) :
+ _format(format)
+ {
+ }
+
+ virtual std::string what() const override {
+ return _format;
+ }
+
+ private:
+ std::string _format;
+ };
+
+ class CatchAdapter : public EventHandler {
+ EventFormatter &_formatter;
+
+ std::string formatLineNumber(std::string file, int num) {
+#ifndef __GNUG__
+ return file + std::string("(") + std::to_string(num) + std::string(")");
+#else
+ return file + std::string(":") + std::to_string(num);
+#endif
+ }
+
+ public:
+
+ virtual ~CatchAdapter() = default;
+
+ CatchAdapter(EventFormatter &formatter)
+ : _formatter(formatter) {}
+
+ virtual void handle(const UnexpectedMethodCallEvent &evt) override {
+ std::string format = _formatter.format(evt);
+ Catch::ResultBuilder __catchResult("FAIL", ::Catch::SourceLineInfo(),
+ "", Catch::ResultDisposition::Normal);
+ __catchResult << format + ::Catch::StreamEndStop();
+ __catchResult.captureResult(Catch::ResultWas::ExplicitFailure);
+ INTERNAL_CATCH_REACT(__catchResult)
+ throw Catch::TestFailureException();
+ }
+
+ virtual void handle(const SequenceVerificationEvent &evt) override {
+ std::string format(formatLineNumber(evt.file(), evt.line()) + ": " + _formatter.format(evt));
+ Catch::ResultBuilder __catchResult("FAIL", ::Catch::SourceLineInfo(evt.file(),
+ static_cast( evt.line())),
+ "", Catch::ResultDisposition::Normal);
+ __catchResult << format + ::Catch::StreamEndStop();
+ __catchResult.captureResult(Catch::ResultWas::ExplicitFailure);
+ INTERNAL_CATCH_REACT(__catchResult)
+ throw Catch::TestFailureException();
+ }
+
+ virtual void handle(const NoMoreInvocationsVerificationEvent &evt) override {
+ std::string format(formatLineNumber(evt.file(), evt.line()) + ": " + _formatter.format(evt));
+ Catch::ResultBuilder __catchResult("FAIL", ::Catch::SourceLineInfo(evt.file(),
+ static_cast( evt.line())),
+ "", Catch::ResultDisposition::Normal);
+ __catchResult << format + ::Catch::StreamEndStop();
+ __catchResult.captureResult(Catch::ResultWas::ExplicitFailure);
+ INTERNAL_CATCH_REACT(__catchResult)
+ throw Catch::TestFailureException();
+ }
+
+ };
+
+
+ class CatchFakeit : public DefaultFakeit {
+
+
+ public:
+
+ virtual ~CatchFakeit() = default;
+
+ CatchFakeit() : _formatter(), _catchAdapter(_formatter) {}
+
+ static CatchFakeit &getInstance() {
+ static CatchFakeit instance;
+ return instance;
+ }
+
+ protected:
+
+ fakeit::EventHandler &accessTestingFrameworkAdapter() override {
+ return _catchAdapter;
+ }
+
+ EventFormatter &accessEventFormatter() override {
+ return _formatter;
+ }
+
+ private:
+
+ DefaultEventFormatter _formatter;
+ CatchAdapter _catchAdapter;
+ };
+
+}
+
+static fakeit::DefaultFakeit& Fakeit = fakeit::CatchFakeit::getInstance();
+
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+namespace fakeit {
+
+ struct VirtualOffsetSelector {
+
+ unsigned int offset;
+
+ virtual unsigned int offset0(int) {
+ return offset = 0;
+ }
+
+ virtual unsigned int offset1(int) {
+ return offset = 1;
+ }
+
+ virtual unsigned int offset2(int) {
+ return offset = 2;
+ }
+
+ virtual unsigned int offset3(int) {
+ return offset = 3;
+ }
+
+ virtual unsigned int offset4(int) {
+ return offset = 4;
+ }
+
+ virtual unsigned int offset5(int) {
+ return offset = 5;
+ }
+
+ virtual unsigned int offset6(int) {
+ return offset = 6;
+ }
+
+ virtual unsigned int offset7(int) {
+ return offset = 7;
+ }
+
+ virtual unsigned int offset8(int) {
+ return offset = 8;
+ }
+
+ virtual unsigned int offset9(int) {
+ return offset = 9;
+ }
+
+ virtual unsigned int offset10(int) {
+ return offset = 10;
+ }
+
+ virtual unsigned int offset11(int) {
+ return offset = 11;
+ }
+
+ virtual unsigned int offset12(int) {
+ return offset = 12;
+ }
+
+ virtual unsigned int offset13(int) {
+ return offset = 13;
+ }
+
+ virtual unsigned int offset14(int) {
+ return offset = 14;
+ }
+
+ virtual unsigned int offset15(int) {
+ return offset = 15;
+ }
+
+ virtual unsigned int offset16(int) {
+ return offset = 16;
+ }
+
+ virtual unsigned int offset17(int) {
+ return offset = 17;
+ }
+
+ virtual unsigned int offset18(int) {
+ return offset = 18;
+ }
+
+ virtual unsigned int offset19(int) {
+ return offset = 19;
+ }
+
+ virtual unsigned int offset20(int) {
+ return offset = 20;
+ }
+
+ virtual unsigned int offset21(int) {
+ return offset = 21;
+ }
+
+ virtual unsigned int offset22(int) {
+ return offset = 22;
+ }
+
+ virtual unsigned int offset23(int) {
+ return offset = 23;
+ }
+
+ virtual unsigned int offset24(int) {
+ return offset = 24;
+ }
+
+ virtual unsigned int offset25(int) {
+ return offset = 25;
+ }
+
+ virtual unsigned int offset26(int) {
+ return offset = 26;
+ }
+
+ virtual unsigned int offset27(int) {
+ return offset = 27;
+ }
+
+ virtual unsigned int offset28(int) {
+ return offset = 28;
+ }
+
+ virtual unsigned int offset29(int) {
+ return offset = 29;
+ }
+
+ virtual unsigned int offset30(int) {
+ return offset = 30;
+ }
+
+ virtual unsigned int offset31(int) {
+ return offset = 31;
+ }
+
+ virtual unsigned int offset32(int) {
+ return offset = 32;
+ }
+
+ virtual unsigned int offset33(int) {
+ return offset = 33;
+ }
+
+ virtual unsigned int offset34(int) {
+ return offset = 34;
+ }
+
+ virtual unsigned int offset35(int) {
+ return offset = 35;
+ }
+
+ virtual unsigned int offset36(int) {
+ return offset = 36;
+ }
+
+ virtual unsigned int offset37(int) {
+ return offset = 37;
+ }
+
+ virtual unsigned int offset38(int) {
+ return offset = 38;
+ }
+
+ virtual unsigned int offset39(int) {
+ return offset = 39;
+ }
+
+ virtual unsigned int offset40(int) {
+ return offset = 40;
+ }
+
+ virtual unsigned int offset41(int) {
+ return offset = 41;
+ }
+
+ virtual unsigned int offset42(int) {
+ return offset = 42;
+ }
+
+ virtual unsigned int offset43(int) {
+ return offset = 43;
+ }
+
+ virtual unsigned int offset44(int) {
+ return offset = 44;
+ }
+
+ virtual unsigned int offset45(int) {
+ return offset = 45;
+ }
+
+ virtual unsigned int offset46(int) {
+ return offset = 46;
+ }
+
+ virtual unsigned int offset47(int) {
+ return offset = 47;
+ }
+
+ virtual unsigned int offset48(int) {
+ return offset = 48;
+ }
+
+ virtual unsigned int offset49(int) {
+ return offset = 49;
+ }
+
+ virtual unsigned int offset50(int) {
+ return offset = 50;
+ }
+
+ virtual unsigned int offset51(int) {
+ return offset = 51;
+ }
+
+ virtual unsigned int offset52(int) {
+ return offset = 52;
+ }
+
+ virtual unsigned int offset53(int) {
+ return offset = 53;
+ }
+
+ virtual unsigned int offset54(int) {
+ return offset = 54;
+ }
+
+ virtual unsigned int offset55(int) {
+ return offset = 55;
+ }
+
+ virtual unsigned int offset56(int) {
+ return offset = 56;
+ }
+
+ virtual unsigned int offset57(int) {
+ return offset = 57;
+ }
+
+ virtual unsigned int offset58(int) {
+ return offset = 58;
+ }
+
+ virtual unsigned int offset59(int) {
+ return offset = 59;
+ }
+
+ virtual unsigned int offset60(int) {
+ return offset = 60;
+ }
+
+ virtual unsigned int offset61(int) {
+ return offset = 61;
+ }
+
+ virtual unsigned int offset62(int) {
+ return offset = 62;
+ }
+
+ virtual unsigned int offset63(int) {
+ return offset = 63;
+ }
+
+ virtual unsigned int offset64(int) {
+ return offset = 64;
+ }
+
+ virtual unsigned int offset65(int) {
+ return offset = 65;
+ }
+
+ virtual unsigned int offset66(int) {
+ return offset = 66;
+ }
+
+ virtual unsigned int offset67(int) {
+ return offset = 67;
+ }
+
+ virtual unsigned int offset68(int) {
+ return offset = 68;
+ }
+
+ virtual unsigned int offset69(int) {
+ return offset = 69;
+ }
+
+ virtual unsigned int offset70(int) {
+ return offset = 70;
+ }
+
+ virtual unsigned int offset71(int) {
+ return offset = 71;
+ }
+
+ virtual unsigned int offset72(int) {
+ return offset = 72;
+ }
+
+ virtual unsigned int offset73(int) {
+ return offset = 73;
+ }
+
+ virtual unsigned int offset74(int) {
+ return offset = 74;
+ }
+
+ virtual unsigned int offset75(int) {
+ return offset = 75;
+ }
+
+ virtual unsigned int offset76(int) {
+ return offset = 76;
+ }
+
+ virtual unsigned int offset77(int) {
+ return offset = 77;
+ }
+
+ virtual unsigned int offset78(int) {
+ return offset = 78;
+ }
+
+ virtual unsigned int offset79(int) {
+ return offset = 79;
+ }
+
+ virtual unsigned int offset80(int) {
+ return offset = 80;
+ }
+
+ virtual unsigned int offset81(int) {
+ return offset = 81;
+ }
+
+ virtual unsigned int offset82(int) {
+ return offset = 82;
+ }
+
+ virtual unsigned int offset83(int) {
+ return offset = 83;
+ }
+
+ virtual unsigned int offset84(int) {
+ return offset = 84;
+ }
+
+ virtual unsigned int offset85(int) {
+ return offset = 85;
+ }
+
+ virtual unsigned int offset86(int) {
+ return offset = 86;
+ }
+
+ virtual unsigned int offset87(int) {
+ return offset = 87;
+ }
+
+ virtual unsigned int offset88(int) {
+ return offset = 88;
+ }
+
+ virtual unsigned int offset89(int) {
+ return offset = 89;
+ }
+
+ virtual unsigned int offset90(int) {
+ return offset = 90;
+ }
+
+ virtual unsigned int offset91(int) {
+ return offset = 91;
+ }
+
+ virtual unsigned int offset92(int) {
+ return offset = 92;
+ }
+
+ virtual unsigned int offset93(int) {
+ return offset = 93;
+ }
+
+ virtual unsigned int offset94(int) {
+ return offset = 94;
+ }
+
+ virtual unsigned int offset95(int) {
+ return offset = 95;
+ }
+
+ virtual unsigned int offset96(int) {
+ return offset = 96;
+ }
+
+ virtual unsigned int offset97(int) {
+ return offset = 97;
+ }
+
+ virtual unsigned int offset98(int) {
+ return offset = 98;
+ }
+
+ virtual unsigned int offset99(int) {
+ return offset = 99;
+ }
+
+ virtual unsigned int offset100(int) {
+ return offset = 100;
+ }
+
+ virtual unsigned int offset101(int) {
+ return offset = 101;
+ }
+
+ virtual unsigned int offset102(int) {
+ return offset = 102;
+ }
+
+ virtual unsigned int offset103(int) {
+ return offset = 103;
+ }
+
+ virtual unsigned int offset104(int) {
+ return offset = 104;
+ }
+
+ virtual unsigned int offset105(int) {
+ return offset = 105;
+ }
+
+ virtual unsigned int offset106(int) {
+ return offset = 106;
+ }
+
+ virtual unsigned int offset107(int) {
+ return offset = 107;
+ }
+
+ virtual unsigned int offset108(int) {
+ return offset = 108;
+ }
+
+ virtual unsigned int offset109(int) {
+ return offset = 109;
+ }
+
+ virtual unsigned int offset110(int) {
+ return offset = 110;
+ }
+
+ virtual unsigned int offset111(int) {
+ return offset = 111;
+ }
+
+ virtual unsigned int offset112(int) {
+ return offset = 112;
+ }
+
+ virtual unsigned int offset113(int) {
+ return offset = 113;
+ }
+
+ virtual unsigned int offset114(int) {
+ return offset = 114;
+ }
+
+ virtual unsigned int offset115(int) {
+ return offset = 115;
+ }
+
+ virtual unsigned int offset116(int) {
+ return offset = 116;
+ }
+
+ virtual unsigned int offset117(int) {
+ return offset = 117;
+ }
+
+ virtual unsigned int offset118(int) {
+ return offset = 118;
+ }
+
+ virtual unsigned int offset119(int) {
+ return offset = 119;
+ }
+
+ virtual unsigned int offset120(int) {
+ return offset = 120;
+ }
+
+ virtual unsigned int offset121(int) {
+ return offset = 121;
+ }
+
+ virtual unsigned int offset122(int) {
+ return offset = 122;
+ }
+
+ virtual unsigned int offset123(int) {
+ return offset = 123;
+ }
+
+ virtual unsigned int offset124(int) {
+ return offset = 124;
+ }
+
+ virtual unsigned int offset125(int) {
+ return offset = 125;
+ }
+
+ virtual unsigned int offset126(int) {
+ return offset = 126;
+ }
+
+ virtual unsigned int offset127(int) {
+ return offset = 127;
+ }
+
+ virtual unsigned int offset128(int) {
+ return offset = 128;
+ }
+
+ virtual unsigned int offset129(int) {
+ return offset = 129;
+ }
+
+ virtual unsigned int offset130(int) {
+ return offset = 130;
+ }
+
+ virtual unsigned int offset131(int) {
+ return offset = 131;
+ }
+
+ virtual unsigned int offset132(int) {
+ return offset = 132;
+ }
+
+ virtual unsigned int offset133(int) {
+ return offset = 133;
+ }
+
+ virtual unsigned int offset134(int) {
+ return offset = 134;
+ }
+
+ virtual unsigned int offset135(int) {
+ return offset = 135;
+ }
+
+ virtual unsigned int offset136(int) {
+ return offset = 136;
+ }
+
+ virtual unsigned int offset137(int) {
+ return offset = 137;
+ }
+
+ virtual unsigned int offset138(int) {
+ return offset = 138;
+ }
+
+ virtual unsigned int offset139(int) {
+ return offset = 139;
+ }
+
+ virtual unsigned int offset140(int) {
+ return offset = 140;
+ }
+
+ virtual unsigned int offset141(int) {
+ return offset = 141;
+ }
+
+ virtual unsigned int offset142(int) {
+ return offset = 142;
+ }
+
+ virtual unsigned int offset143(int) {
+ return offset = 143;
+ }
+
+ virtual unsigned int offset144(int) {
+ return offset = 144;
+ }
+
+ virtual unsigned int offset145(int) {
+ return offset = 145;
+ }
+
+ virtual unsigned int offset146(int) {
+ return offset = 146;
+ }
+
+ virtual unsigned int offset147(int) {
+ return offset = 147;
+ }
+
+ virtual unsigned int offset148(int) {
+ return offset = 148;
+ }
+
+ virtual unsigned int offset149(int) {
+ return offset = 149;
+ }
+
+ virtual unsigned int offset150(int) {
+ return offset = 150;
+ }
+
+ virtual unsigned int offset151(int) {
+ return offset = 151;
+ }
+
+ virtual unsigned int offset152(int) {
+ return offset = 152;
+ }
+
+ virtual unsigned int offset153(int) {
+ return offset = 153;
+ }
+
+ virtual unsigned int offset154(int) {
+ return offset = 154;
+ }
+
+ virtual unsigned int offset155(int) {
+ return offset = 155;
+ }
+
+ virtual unsigned int offset156(int) {
+ return offset = 156;
+ }
+
+ virtual unsigned int offset157(int) {
+ return offset = 157;
+ }
+
+ virtual unsigned int offset158(int) {
+ return offset = 158;
+ }
+
+ virtual unsigned int offset159(int) {
+ return offset = 159;
+ }
+
+ virtual unsigned int offset160(int) {
+ return offset = 160;
+ }
+
+ virtual unsigned int offset161(int) {
+ return offset = 161;
+ }
+
+ virtual unsigned int offset162(int) {
+ return offset = 162;
+ }
+
+ virtual unsigned int offset163(int) {
+ return offset = 163;
+ }
+
+ virtual unsigned int offset164(int) {
+ return offset = 164;
+ }
+
+ virtual unsigned int offset165(int) {
+ return offset = 165;
+ }
+
+ virtual unsigned int offset166(int) {
+ return offset = 166;
+ }
+
+ virtual unsigned int offset167(int) {
+ return offset = 167;
+ }
+
+ virtual unsigned int offset168(int) {
+ return offset = 168;
+ }
+
+ virtual unsigned int offset169(int) {
+ return offset = 169;
+ }
+
+ virtual unsigned int offset170(int) {
+ return offset = 170;
+ }
+
+ virtual unsigned int offset171(int) {
+ return offset = 171;
+ }
+
+ virtual unsigned int offset172(int) {
+ return offset = 172;
+ }
+
+ virtual unsigned int offset173(int) {
+ return offset = 173;
+ }
+
+ virtual unsigned int offset174(int) {
+ return offset = 174;
+ }
+
+ virtual unsigned int offset175(int) {
+ return offset = 175;
+ }
+
+ virtual unsigned int offset176(int) {
+ return offset = 176;
+ }
+
+ virtual unsigned int offset177(int) {
+ return offset = 177;
+ }
+
+ virtual unsigned int offset178(int) {
+ return offset = 178;
+ }
+
+ virtual unsigned int offset179(int) {
+ return offset = 179;
+ }
+
+ virtual unsigned int offset180(int) {
+ return offset = 180;
+ }
+
+ virtual unsigned int offset181(int) {
+ return offset = 181;
+ }
+
+ virtual unsigned int offset182(int) {
+ return offset = 182;
+ }
+
+ virtual unsigned int offset183(int) {
+ return offset = 183;
+ }
+
+ virtual unsigned int offset184(int) {
+ return offset = 184;
+ }
+
+ virtual unsigned int offset185(int) {
+ return offset = 185;
+ }
+
+ virtual unsigned int offset186(int) {
+ return offset = 186;
+ }
+
+ virtual unsigned int offset187(int) {
+ return offset = 187;
+ }
+
+ virtual unsigned int offset188(int) {
+ return offset = 188;
+ }
+
+ virtual unsigned int offset189(int) {
+ return offset = 189;
+ }
+
+ virtual unsigned int offset190(int) {
+ return offset = 190;
+ }
+
+ virtual unsigned int offset191(int) {
+ return offset = 191;
+ }
+
+ virtual unsigned int offset192(int) {
+ return offset = 192;
+ }
+
+ virtual unsigned int offset193(int) {
+ return offset = 193;
+ }
+
+ virtual unsigned int offset194(int) {
+ return offset = 194;
+ }
+
+ virtual unsigned int offset195(int) {
+ return offset = 195;
+ }
+
+ virtual unsigned int offset196(int) {
+ return offset = 196;
+ }
+
+ virtual unsigned int offset197(int) {
+ return offset = 197;
+ }
+
+ virtual unsigned int offset198(int) {
+ return offset = 198;
+ }
+
+ virtual unsigned int offset199(int) {
+ return offset = 199;
+ }
+
+
+ virtual unsigned int offset200(int) {
+ return offset = 200;
+ }
+
+ virtual unsigned int offset201(int) {
+ return offset = 201;
+ }
+
+ virtual unsigned int offset202(int) {
+ return offset = 202;
+ }
+
+ virtual unsigned int offset203(int) {
+ return offset = 203;
+ }
+
+ virtual unsigned int offset204(int) {
+ return offset = 204;
+ }
+
+ virtual unsigned int offset205(int) {
+ return offset = 205;
+ }
+
+ virtual unsigned int offset206(int) {
+ return offset = 206;
+ }
+
+ virtual unsigned int offset207(int) {
+ return offset = 207;
+ }
+
+ virtual unsigned int offset208(int) {
+ return offset = 208;
+ }
+
+ virtual unsigned int offset209(int) {
+ return offset = 209;
+ }
+
+ virtual unsigned int offset210(int) {
+ return offset = 210;
+ }
+
+ virtual unsigned int offset211(int) {
+ return offset = 211;
+ }
+
+ virtual unsigned int offset212(int) {
+ return offset = 212;
+ }
+
+ virtual unsigned int offset213(int) {
+ return offset = 213;
+ }
+
+ virtual unsigned int offset214(int) {
+ return offset = 214;
+ }
+
+ virtual unsigned int offset215(int) {
+ return offset = 215;
+ }
+
+ virtual unsigned int offset216(int) {
+ return offset = 216;
+ }
+
+ virtual unsigned int offset217(int) {
+ return offset = 217;
+ }
+
+ virtual unsigned int offset218(int) {
+ return offset = 218;
+ }
+
+ virtual unsigned int offset219(int) {
+ return offset = 219;
+ }
+
+ virtual unsigned int offset220(int) {
+ return offset = 220;
+ }
+
+ virtual unsigned int offset221(int) {
+ return offset = 221;
+ }
+
+ virtual unsigned int offset222(int) {
+ return offset = 222;
+ }
+
+ virtual unsigned int offset223(int) {
+ return offset = 223;
+ }
+
+ virtual unsigned int offset224(int) {
+ return offset = 224;
+ }
+
+ virtual unsigned int offset225(int) {
+ return offset = 225;
+ }
+
+ virtual unsigned int offset226(int) {
+ return offset = 226;
+ }
+
+ virtual unsigned int offset227(int) {
+ return offset = 227;
+ }
+
+ virtual unsigned int offset228(int) {
+ return offset = 228;
+ }
+
+ virtual unsigned int offset229(int) {
+ return offset = 229;
+ }
+
+ virtual unsigned int offset230(int) {
+ return offset = 230;
+ }
+
+ virtual unsigned int offset231(int) {
+ return offset = 231;
+ }
+
+ virtual unsigned int offset232(int) {
+ return offset = 232;
+ }
+
+ virtual unsigned int offset233(int) {
+ return offset = 233;
+ }
+
+ virtual unsigned int offset234(int) {
+ return offset = 234;
+ }
+
+ virtual unsigned int offset235(int) {
+ return offset = 235;
+ }
+
+ virtual unsigned int offset236(int) {
+ return offset = 236;
+ }
+
+ virtual unsigned int offset237(int) {
+ return offset = 237;
+ }
+
+ virtual unsigned int offset238(int) {
+ return offset = 238;
+ }
+
+ virtual unsigned int offset239(int) {
+ return offset = 239;
+ }
+
+ virtual unsigned int offset240(int) {
+ return offset = 240;
+ }
+
+ virtual unsigned int offset241(int) {
+ return offset = 241;
+ }
+
+ virtual unsigned int offset242(int) {
+ return offset = 242;
+ }
+
+ virtual unsigned int offset243(int) {
+ return offset = 243;
+ }
+
+ virtual unsigned int offset244(int) {
+ return offset = 244;
+ }
+
+ virtual unsigned int offset245(int) {
+ return offset = 245;
+ }
+
+ virtual unsigned int offset246(int) {
+ return offset = 246;
+ }
+
+ virtual unsigned int offset247(int) {
+ return offset = 247;
+ }
+
+ virtual unsigned int offset248(int) {
+ return offset = 248;
+ }
+
+ virtual unsigned int offset249(int) {
+ return offset = 249;
+ }
+
+ virtual unsigned int offset250(int) {
+ return offset = 250;
+ }
+
+ virtual unsigned int offset251(int) {
+ return offset = 251;
+ }
+
+ virtual unsigned int offset252(int) {
+ return offset = 252;
+ }
+
+ virtual unsigned int offset253(int) {
+ return offset = 253;
+ }
+
+ virtual unsigned int offset254(int) {
+ return offset = 254;
+ }
+
+ virtual unsigned int offset255(int) {
+ return offset = 255;
+ }
+
+ virtual unsigned int offset256(int) {
+ return offset = 256;
+ }
+
+ virtual unsigned int offset257(int) {
+ return offset = 257;
+ }
+
+ virtual unsigned int offset258(int) {
+ return offset = 258;
+ }
+
+ virtual unsigned int offset259(int) {
+ return offset = 259;
+ }
+
+ virtual unsigned int offset260(int) {
+ return offset = 260;
+ }
+
+ virtual unsigned int offset261(int) {
+ return offset = 261;
+ }
+
+ virtual unsigned int offset262(int) {
+ return offset = 262;
+ }
+
+ virtual unsigned int offset263(int) {
+ return offset = 263;
+ }
+
+ virtual unsigned int offset264(int) {
+ return offset = 264;
+ }
+
+ virtual unsigned int offset265(int) {
+ return offset = 265;
+ }
+
+ virtual unsigned int offset266(int) {
+ return offset = 266;
+ }
+
+ virtual unsigned int offset267(int) {
+ return offset = 267;
+ }
+
+ virtual unsigned int offset268(int) {
+ return offset = 268;
+ }
+
+ virtual unsigned int offset269(int) {
+ return offset = 269;
+ }
+
+ virtual unsigned int offset270(int) {
+ return offset = 270;
+ }
+
+ virtual unsigned int offset271(int) {
+ return offset = 271;
+ }
+
+ virtual unsigned int offset272(int) {
+ return offset = 272;
+ }
+
+ virtual unsigned int offset273(int) {
+ return offset = 273;
+ }
+
+ virtual unsigned int offset274(int) {
+ return offset = 274;
+ }
+
+ virtual unsigned int offset275(int) {
+ return offset = 275;
+ }
+
+ virtual unsigned int offset276(int) {
+ return offset = 276;
+ }
+
+ virtual unsigned int offset277(int) {
+ return offset = 277;
+ }
+
+ virtual unsigned int offset278(int) {
+ return offset = 278;
+ }
+
+ virtual unsigned int offset279(int) {
+ return offset = 279;
+ }
+
+ virtual unsigned int offset280(int) {
+ return offset = 280;
+ }
+
+ virtual unsigned int offset281(int) {
+ return offset = 281;
+ }
+
+ virtual unsigned int offset282(int) {
+ return offset = 282;
+ }
+
+ virtual unsigned int offset283(int) {
+ return offset = 283;
+ }
+
+ virtual unsigned int offset284(int) {
+ return offset = 284;
+ }
+
+ virtual unsigned int offset285(int) {
+ return offset = 285;
+ }
+
+ virtual unsigned int offset286(int) {
+ return offset = 286;
+ }
+
+ virtual unsigned int offset287(int) {
+ return offset = 287;
+ }
+
+ virtual unsigned int offset288(int) {
+ return offset = 288;
+ }
+
+ virtual unsigned int offset289(int) {
+ return offset = 289;
+ }
+
+ virtual unsigned int offset290(int) {
+ return offset = 290;
+ }
+
+ virtual unsigned int offset291(int) {
+ return offset = 291;
+ }
+
+ virtual unsigned int offset292(int) {
+ return offset = 292;
+ }
+
+ virtual unsigned int offset293(int) {
+ return offset = 293;
+ }
+
+ virtual unsigned int offset294(int) {
+ return offset = 294;
+ }
+
+ virtual unsigned int offset295(int) {
+ return offset = 295;
+ }
+
+ virtual unsigned int offset296(int) {
+ return offset = 296;
+ }
+
+ virtual unsigned int offset297(int) {
+ return offset = 297;
+ }
+
+ virtual unsigned int offset298(int) {
+ return offset = 298;
+ }
+
+ virtual unsigned int offset299(int) {
+ return offset = 299;
+ }
+
+
+ virtual unsigned int offset300(int) {
+ return offset = 300;
+ }
+
+ virtual unsigned int offset301(int) {
+ return offset = 301;
+ }
+
+ virtual unsigned int offset302(int) {
+ return offset = 302;
+ }
+
+ virtual unsigned int offset303(int) {
+ return offset = 303;
+ }
+
+ virtual unsigned int offset304(int) {
+ return offset = 304;
+ }
+
+ virtual unsigned int offset305(int) {
+ return offset = 305;
+ }
+
+ virtual unsigned int offset306(int) {
+ return offset = 306;
+ }
+
+ virtual unsigned int offset307(int) {
+ return offset = 307;
+ }
+
+ virtual unsigned int offset308(int) {
+ return offset = 308;
+ }
+
+ virtual unsigned int offset309(int) {
+ return offset = 309;
+ }
+
+ virtual unsigned int offset310(int) {
+ return offset = 310;
+ }
+
+ virtual unsigned int offset311(int) {
+ return offset = 311;
+ }
+
+ virtual unsigned int offset312(int) {
+ return offset = 312;
+ }
+
+ virtual unsigned int offset313(int) {
+ return offset = 313;
+ }
+
+ virtual unsigned int offset314(int) {
+ return offset = 314;
+ }
+
+ virtual unsigned int offset315(int) {
+ return offset = 315;
+ }
+
+ virtual unsigned int offset316(int) {
+ return offset = 316;
+ }
+
+ virtual unsigned int offset317(int) {
+ return offset = 317;
+ }
+
+ virtual unsigned int offset318(int) {
+ return offset = 318;
+ }
+
+ virtual unsigned int offset319(int) {
+ return offset = 319;
+ }
+
+ virtual unsigned int offset320(int) {
+ return offset = 320;
+ }
+
+ virtual unsigned int offset321(int) {
+ return offset = 321;
+ }
+
+ virtual unsigned int offset322(int) {
+ return offset = 322;
+ }
+
+ virtual unsigned int offset323(int) {
+ return offset = 323;
+ }
+
+ virtual unsigned int offset324(int) {
+ return offset = 324;
+ }
+
+ virtual unsigned int offset325(int) {
+ return offset = 325;
+ }
+
+ virtual unsigned int offset326(int) {
+ return offset = 326;
+ }
+
+ virtual unsigned int offset327(int) {
+ return offset = 327;
+ }
+
+ virtual unsigned int offset328(int) {
+ return offset = 328;
+ }
+
+ virtual unsigned int offset329(int) {
+ return offset = 329;
+ }
+
+ virtual unsigned int offset330(int) {
+ return offset = 330;
+ }
+
+ virtual unsigned int offset331(int) {
+ return offset = 331;
+ }
+
+ virtual unsigned int offset332(int) {
+ return offset = 332;
+ }
+
+ virtual unsigned int offset333(int) {
+ return offset = 333;
+ }
+
+ virtual unsigned int offset334(int) {
+ return offset = 334;
+ }
+
+ virtual unsigned int offset335(int) {
+ return offset = 335;
+ }
+
+ virtual unsigned int offset336(int) {
+ return offset = 336;
+ }
+
+ virtual unsigned int offset337(int) {
+ return offset = 337;
+ }
+
+ virtual unsigned int offset338(int) {
+ return offset = 338;
+ }
+
+ virtual unsigned int offset339(int) {
+ return offset = 339;
+ }
+
+ virtual unsigned int offset340(int) {
+ return offset = 340;
+ }
+
+ virtual unsigned int offset341(int) {
+ return offset = 341;
+ }
+
+ virtual unsigned int offset342(int) {
+ return offset = 342;
+ }
+
+ virtual unsigned int offset343(int) {
+ return offset = 343;
+ }
+
+ virtual unsigned int offset344(int) {
+ return offset = 344;
+ }
+
+ virtual unsigned int offset345(int) {
+ return offset = 345;
+ }
+
+ virtual unsigned int offset346(int) {
+ return offset = 346;
+ }
+
+ virtual unsigned int offset347(int) {
+ return offset = 347;
+ }
+
+ virtual unsigned int offset348(int) {
+ return offset = 348;
+ }
+
+ virtual unsigned int offset349(int) {
+ return offset = 349;
+ }
+
+ virtual unsigned int offset350(int) {
+ return offset = 350;
+ }
+
+ virtual unsigned int offset351(int) {
+ return offset = 351;
+ }
+
+ virtual unsigned int offset352(int) {
+ return offset = 352;
+ }
+
+ virtual unsigned int offset353(int) {
+ return offset = 353;
+ }
+
+ virtual unsigned int offset354(int) {
+ return offset = 354;
+ }
+
+ virtual unsigned int offset355(int) {
+ return offset = 355;
+ }
+
+ virtual unsigned int offset356(int) {
+ return offset = 356;
+ }
+
+ virtual unsigned int offset357(int) {
+ return offset = 357;
+ }
+
+ virtual unsigned int offset358(int) {
+ return offset = 358;
+ }
+
+ virtual unsigned int offset359(int) {
+ return offset = 359;
+ }
+
+ virtual unsigned int offset360(int) {
+ return offset = 360;
+ }
+
+ virtual unsigned int offset361(int) {
+ return offset = 361;
+ }
+
+ virtual unsigned int offset362(int) {
+ return offset = 362;
+ }
+
+ virtual unsigned int offset363(int) {
+ return offset = 363;
+ }
+
+ virtual unsigned int offset364(int) {
+ return offset = 364;
+ }
+
+ virtual unsigned int offset365(int) {
+ return offset = 365;
+ }
+
+ virtual unsigned int offset366(int) {
+ return offset = 366;
+ }
+
+ virtual unsigned int offset367(int) {
+ return offset = 367;
+ }
+
+ virtual unsigned int offset368(int) {
+ return offset = 368;
+ }
+
+ virtual unsigned int offset369(int) {
+ return offset = 369;
+ }
+
+ virtual unsigned int offset370(int) {
+ return offset = 370;
+ }
+
+ virtual unsigned int offset371(int) {
+ return offset = 371;
+ }
+
+ virtual unsigned int offset372(int) {
+ return offset = 372;
+ }
+
+ virtual unsigned int offset373(int) {
+ return offset = 373;
+ }
+
+ virtual unsigned int offset374(int) {
+ return offset = 374;
+ }
+
+ virtual unsigned int offset375(int) {
+ return offset = 375;
+ }
+
+ virtual unsigned int offset376(int) {
+ return offset = 376;
+ }
+
+ virtual unsigned int offset377(int) {
+ return offset = 377;
+ }
+
+ virtual unsigned int offset378(int) {
+ return offset = 378;
+ }
+
+ virtual unsigned int offset379(int) {
+ return offset = 379;
+ }
+
+ virtual unsigned int offset380(int) {
+ return offset = 380;
+ }
+
+ virtual unsigned int offset381(int) {
+ return offset = 381;
+ }
+
+ virtual unsigned int offset382(int) {
+ return offset = 382;
+ }
+
+ virtual unsigned int offset383(int) {
+ return offset = 383;
+ }
+
+ virtual unsigned int offset384(int) {
+ return offset = 384;
+ }
+
+ virtual unsigned int offset385(int) {
+ return offset = 385;
+ }
+
+ virtual unsigned int offset386(int) {
+ return offset = 386;
+ }
+
+ virtual unsigned int offset387(int) {
+ return offset = 387;
+ }
+
+ virtual unsigned int offset388(int) {
+ return offset = 388;
+ }
+
+ virtual unsigned int offset389(int) {
+ return offset = 389;
+ }
+
+ virtual unsigned int offset390(int) {
+ return offset = 390;
+ }
+
+ virtual unsigned int offset391(int) {
+ return offset = 391;
+ }
+
+ virtual unsigned int offset392(int) {
+ return offset = 392;
+ }
+
+ virtual unsigned int offset393(int) {
+ return offset = 393;
+ }
+
+ virtual unsigned int offset394(int) {
+ return offset = 394;
+ }
+
+ virtual unsigned int offset395(int) {
+ return offset = 395;
+ }
+
+ virtual unsigned int offset396(int) {
+ return offset = 396;
+ }
+
+ virtual unsigned int offset397(int) {
+ return offset = 397;
+ }
+
+ virtual unsigned int offset398(int) {
+ return offset = 398;
+ }
+
+ virtual unsigned int offset399(int) {
+ return offset = 399;
+ }
+
+
+ virtual unsigned int offset400(int) {
+ return offset = 400;
+ }
+
+ virtual unsigned int offset401(int) {
+ return offset = 401;
+ }
+
+ virtual unsigned int offset402(int) {
+ return offset = 402;
+ }
+
+ virtual unsigned int offset403(int) {
+ return offset = 403;
+ }
+
+ virtual unsigned int offset404(int) {
+ return offset = 404;
+ }
+
+ virtual unsigned int offset405(int) {
+ return offset = 405;
+ }
+
+ virtual unsigned int offset406(int) {
+ return offset = 406;
+ }
+
+ virtual unsigned int offset407(int) {
+ return offset = 407;
+ }
+
+ virtual unsigned int offset408(int) {
+ return offset = 408;
+ }
+
+ virtual unsigned int offset409(int) {
+ return offset = 409;
+ }
+
+ virtual unsigned int offset410(int) {
+ return offset = 410;
+ }
+
+ virtual unsigned int offset411(int) {
+ return offset = 411;
+ }
+
+ virtual unsigned int offset412(int) {
+ return offset = 412;
+ }
+
+ virtual unsigned int offset413(int) {
+ return offset = 413;
+ }
+
+ virtual unsigned int offset414(int) {
+ return offset = 414;
+ }
+
+ virtual unsigned int offset415(int) {
+ return offset = 415;
+ }
+
+ virtual unsigned int offset416(int) {
+ return offset = 416;
+ }
+
+ virtual unsigned int offset417(int) {
+ return offset = 417;
+ }
+
+ virtual unsigned int offset418(int) {
+ return offset = 418;
+ }
+
+ virtual unsigned int offset419(int) {
+ return offset = 419;
+ }
+
+ virtual unsigned int offset420(int) {
+ return offset = 420;
+ }
+
+ virtual unsigned int offset421(int) {
+ return offset = 421;
+ }
+
+ virtual unsigned int offset422(int) {
+ return offset = 422;
+ }
+
+ virtual unsigned int offset423(int) {
+ return offset = 423;
+ }
+
+ virtual unsigned int offset424(int) {
+ return offset = 424;
+ }
+
+ virtual unsigned int offset425(int) {
+ return offset = 425;
+ }
+
+ virtual unsigned int offset426(int) {
+ return offset = 426;
+ }
+
+ virtual unsigned int offset427(int) {
+ return offset = 427;
+ }
+
+ virtual unsigned int offset428(int) {
+ return offset = 428;
+ }
+
+ virtual unsigned int offset429(int) {
+ return offset = 429;
+ }
+
+ virtual unsigned int offset430(int) {
+ return offset = 430;
+ }
+
+ virtual unsigned int offset431(int) {
+ return offset = 431;
+ }
+
+ virtual unsigned int offset432(int) {
+ return offset = 432;
+ }
+
+ virtual unsigned int offset433(int) {
+ return offset = 433;
+ }
+
+ virtual unsigned int offset434(int) {
+ return offset = 434;
+ }
+
+ virtual unsigned int offset435(int) {
+ return offset = 435;
+ }
+
+ virtual unsigned int offset436(int) {
+ return offset = 436;
+ }
+
+ virtual unsigned int offset437(int) {
+ return offset = 437;
+ }
+
+ virtual unsigned int offset438(int) {
+ return offset = 438;
+ }
+
+ virtual unsigned int offset439(int) {
+ return offset = 439;
+ }
+
+ virtual unsigned int offset440(int) {
+ return offset = 440;
+ }
+
+ virtual unsigned int offset441(int) {
+ return offset = 441;
+ }
+
+ virtual unsigned int offset442(int) {
+ return offset = 442;
+ }
+
+ virtual unsigned int offset443(int) {
+ return offset = 443;
+ }
+
+ virtual unsigned int offset444(int) {
+ return offset = 444;
+ }
+
+ virtual unsigned int offset445(int) {
+ return offset = 445;
+ }
+
+ virtual unsigned int offset446(int) {
+ return offset = 446;
+ }
+
+ virtual unsigned int offset447(int) {
+ return offset = 447;
+ }
+
+ virtual unsigned int offset448(int) {
+ return offset = 448;
+ }
+
+ virtual unsigned int offset449(int) {
+ return offset = 449;
+ }
+
+ virtual unsigned int offset450(int) {
+ return offset = 450;
+ }
+
+ virtual unsigned int offset451(int) {
+ return offset = 451;
+ }
+
+ virtual unsigned int offset452(int) {
+ return offset = 452;
+ }
+
+ virtual unsigned int offset453(int) {
+ return offset = 453;
+ }
+
+ virtual unsigned int offset454(int) {
+ return offset = 454;
+ }
+
+ virtual unsigned int offset455(int) {
+ return offset = 455;
+ }
+
+ virtual unsigned int offset456(int) {
+ return offset = 456;
+ }
+
+ virtual unsigned int offset457(int) {
+ return offset = 457;
+ }
+
+ virtual unsigned int offset458(int) {
+ return offset = 458;
+ }
+
+ virtual unsigned int offset459(int) {
+ return offset = 459;
+ }
+
+ virtual unsigned int offset460(int) {
+ return offset = 460;
+ }
+
+ virtual unsigned int offset461(int) {
+ return offset = 461;
+ }
+
+ virtual unsigned int offset462(int) {
+ return offset = 462;
+ }
+
+ virtual unsigned int offset463(int) {
+ return offset = 463;
+ }
+
+ virtual unsigned int offset464(int) {
+ return offset = 464;
+ }
+
+ virtual unsigned int offset465(int) {
+ return offset = 465;
+ }
+
+ virtual unsigned int offset466(int) {
+ return offset = 466;
+ }
+
+ virtual unsigned int offset467(int) {
+ return offset = 467;
+ }
+
+ virtual unsigned int offset468(int) {
+ return offset = 468;
+ }
+
+ virtual unsigned int offset469(int) {
+ return offset = 469;
+ }
+
+ virtual unsigned int offset470(int) {
+ return offset = 470;
+ }
+
+ virtual unsigned int offset471(int) {
+ return offset = 471;
+ }
+
+ virtual unsigned int offset472(int) {
+ return offset = 472;
+ }
+
+ virtual unsigned int offset473(int) {
+ return offset = 473;
+ }
+
+ virtual unsigned int offset474(int) {
+ return offset = 474;
+ }
+
+ virtual unsigned int offset475(int) {
+ return offset = 475;
+ }
+
+ virtual unsigned int offset476(int) {
+ return offset = 476;
+ }
+
+ virtual unsigned int offset477(int) {
+ return offset = 477;
+ }
+
+ virtual unsigned int offset478(int) {
+ return offset = 478;
+ }
+
+ virtual unsigned int offset479(int) {
+ return offset = 479;
+ }
+
+ virtual unsigned int offset480(int) {
+ return offset = 480;
+ }
+
+ virtual unsigned int offset481(int) {
+ return offset = 481;
+ }
+
+ virtual unsigned int offset482(int) {
+ return offset = 482;
+ }
+
+ virtual unsigned int offset483(int) {
+ return offset = 483;
+ }
+
+ virtual unsigned int offset484(int) {
+ return offset = 484;
+ }
+
+ virtual unsigned int offset485(int) {
+ return offset = 485;
+ }
+
+ virtual unsigned int offset486(int) {
+ return offset = 486;
+ }
+
+ virtual unsigned int offset487(int) {
+ return offset = 487;
+ }
+
+ virtual unsigned int offset488(int) {
+ return offset = 488;
+ }
+
+ virtual unsigned int offset489(int) {
+ return offset = 489;
+ }
+
+ virtual unsigned int offset490(int) {
+ return offset = 490;
+ }
+
+ virtual unsigned int offset491(int) {
+ return offset = 491;
+ }
+
+ virtual unsigned int offset492(int) {
+ return offset = 492;
+ }
+
+ virtual unsigned int offset493(int) {
+ return offset = 493;
+ }
+
+ virtual unsigned int offset494(int) {
+ return offset = 494;
+ }
+
+ virtual unsigned int offset495(int) {
+ return offset = 495;
+ }
+
+ virtual unsigned int offset496(int) {
+ return offset = 496;
+ }
+
+ virtual unsigned int offset497(int) {
+ return offset = 497;
+ }
+
+ virtual unsigned int offset498(int) {
+ return offset = 498;
+ }
+
+ virtual unsigned int offset499(int) {
+ return offset = 499;
+ }
+
+
+ virtual unsigned int offset500(int) {
+ return offset = 500;
+ }
+
+ virtual unsigned int offset501(int) {
+ return offset = 501;
+ }
+
+ virtual unsigned int offset502(int) {
+ return offset = 502;
+ }
+
+ virtual unsigned int offset503(int) {
+ return offset = 503;
+ }
+
+ virtual unsigned int offset504(int) {
+ return offset = 504;
+ }
+
+ virtual unsigned int offset505(int) {
+ return offset = 505;
+ }
+
+ virtual unsigned int offset506(int) {
+ return offset = 506;
+ }
+
+ virtual unsigned int offset507(int) {
+ return offset = 507;
+ }
+
+ virtual unsigned int offset508(int) {
+ return offset = 508;
+ }
+
+ virtual unsigned int offset509(int) {
+ return offset = 509;
+ }
+
+ virtual unsigned int offset510(int) {
+ return offset = 510;
+ }
+
+ virtual unsigned int offset511(int) {
+ return offset = 511;
+ }
+
+ virtual unsigned int offset512(int) {
+ return offset = 512;
+ }
+
+ virtual unsigned int offset513(int) {
+ return offset = 513;
+ }
+
+ virtual unsigned int offset514(int) {
+ return offset = 514;
+ }
+
+ virtual unsigned int offset515(int) {
+ return offset = 515;
+ }
+
+ virtual unsigned int offset516(int) {
+ return offset = 516;
+ }
+
+ virtual unsigned int offset517(int) {
+ return offset = 517;
+ }
+
+ virtual unsigned int offset518(int) {
+ return offset = 518;
+ }
+
+ virtual unsigned int offset519(int) {
+ return offset = 519;
+ }
+
+ virtual unsigned int offset520(int) {
+ return offset = 520;
+ }
+
+ virtual unsigned int offset521(int) {
+ return offset = 521;
+ }
+
+ virtual unsigned int offset522(int) {
+ return offset = 522;
+ }
+
+ virtual unsigned int offset523(int) {
+ return offset = 523;
+ }
+
+ virtual unsigned int offset524(int) {
+ return offset = 524;
+ }
+
+ virtual unsigned int offset525(int) {
+ return offset = 525;
+ }
+
+ virtual unsigned int offset526(int) {
+ return offset = 526;
+ }
+
+ virtual unsigned int offset527(int) {
+ return offset = 527;
+ }
+
+ virtual unsigned int offset528(int) {
+ return offset = 528;
+ }
+
+ virtual unsigned int offset529(int) {
+ return offset = 529;
+ }
+
+ virtual unsigned int offset530(int) {
+ return offset = 530;
+ }
+
+ virtual unsigned int offset531(int) {
+ return offset = 531;
+ }
+
+ virtual unsigned int offset532(int) {
+ return offset = 532;
+ }
+
+ virtual unsigned int offset533(int) {
+ return offset = 533;
+ }
+
+ virtual unsigned int offset534(int) {
+ return offset = 534;
+ }
+
+ virtual unsigned int offset535(int) {
+ return offset = 535;
+ }
+
+ virtual unsigned int offset536(int) {
+ return offset = 536;
+ }
+
+ virtual unsigned int offset537(int) {
+ return offset = 537;
+ }
+
+ virtual unsigned int offset538(int) {
+ return offset = 538;
+ }
+
+ virtual unsigned int offset539(int) {
+ return offset = 539;
+ }
+
+ virtual unsigned int offset540(int) {
+ return offset = 540;
+ }
+
+ virtual unsigned int offset541(int) {
+ return offset = 541;
+ }
+
+ virtual unsigned int offset542(int) {
+ return offset = 542;
+ }
+
+ virtual unsigned int offset543(int) {
+ return offset = 543;
+ }
+
+ virtual unsigned int offset544(int) {
+ return offset = 544;
+ }
+
+ virtual unsigned int offset545(int) {
+ return offset = 545;
+ }
+
+ virtual unsigned int offset546(int) {
+ return offset = 546;
+ }
+
+ virtual unsigned int offset547(int) {
+ return offset = 547;
+ }
+
+ virtual unsigned int offset548(int) {
+ return offset = 548;
+ }
+
+ virtual unsigned int offset549(int) {
+ return offset = 549;
+ }
+
+ virtual unsigned int offset550(int) {
+ return offset = 550;
+ }
+
+ virtual unsigned int offset551(int) {
+ return offset = 551;
+ }
+
+ virtual unsigned int offset552(int) {
+ return offset = 552;
+ }
+
+ virtual unsigned int offset553(int) {
+ return offset = 553;
+ }
+
+ virtual unsigned int offset554(int) {
+ return offset = 554;
+ }
+
+ virtual unsigned int offset555(int) {
+ return offset = 555;
+ }
+
+ virtual unsigned int offset556(int) {
+ return offset = 556;
+ }
+
+ virtual unsigned int offset557(int) {
+ return offset = 557;
+ }
+
+ virtual unsigned int offset558(int) {
+ return offset = 558;
+ }
+
+ virtual unsigned int offset559(int) {
+ return offset = 559;
+ }
+
+ virtual unsigned int offset560(int) {
+ return offset = 560;
+ }
+
+ virtual unsigned int offset561(int) {
+ return offset = 561;
+ }
+
+ virtual unsigned int offset562(int) {
+ return offset = 562;
+ }
+
+ virtual unsigned int offset563(int) {
+ return offset = 563;
+ }
+
+ virtual unsigned int offset564(int) {
+ return offset = 564;
+ }
+
+ virtual unsigned int offset565(int) {
+ return offset = 565;
+ }
+
+ virtual unsigned int offset566(int) {
+ return offset = 566;
+ }
+
+ virtual unsigned int offset567(int) {
+ return offset = 567;
+ }
+
+ virtual unsigned int offset568(int) {
+ return offset = 568;
+ }
+
+ virtual unsigned int offset569(int) {
+ return offset = 569;
+ }
+
+ virtual unsigned int offset570(int) {
+ return offset = 570;
+ }
+
+ virtual unsigned int offset571(int) {
+ return offset = 571;
+ }
+
+ virtual unsigned int offset572(int) {
+ return offset = 572;
+ }
+
+ virtual unsigned int offset573(int) {
+ return offset = 573;
+ }
+
+ virtual unsigned int offset574(int) {
+ return offset = 574;
+ }
+
+ virtual unsigned int offset575(int) {
+ return offset = 575;
+ }
+
+ virtual unsigned int offset576(int) {
+ return offset = 576;
+ }
+
+ virtual unsigned int offset577(int) {
+ return offset = 577;
+ }
+
+ virtual unsigned int offset578(int) {
+ return offset = 578;
+ }
+
+ virtual unsigned int offset579(int) {
+ return offset = 579;
+ }
+
+ virtual unsigned int offset580(int) {
+ return offset = 580;
+ }
+
+ virtual unsigned int offset581(int) {
+ return offset = 581;
+ }
+
+ virtual unsigned int offset582(int) {
+ return offset = 582;
+ }
+
+ virtual unsigned int offset583(int) {
+ return offset = 583;
+ }
+
+ virtual unsigned int offset584(int) {
+ return offset = 584;
+ }
+
+ virtual unsigned int offset585(int) {
+ return offset = 585;
+ }
+
+ virtual unsigned int offset586(int) {
+ return offset = 586;
+ }
+
+ virtual unsigned int offset587(int) {
+ return offset = 587;
+ }
+
+ virtual unsigned int offset588(int) {
+ return offset = 588;
+ }
+
+ virtual unsigned int offset589(int) {
+ return offset = 589;
+ }
+
+ virtual unsigned int offset590(int) {
+ return offset = 590;
+ }
+
+ virtual unsigned int offset591(int) {
+ return offset = 591;
+ }
+
+ virtual unsigned int offset592(int) {
+ return offset = 592;
+ }
+
+ virtual unsigned int offset593(int) {
+ return offset = 593;
+ }
+
+ virtual unsigned int offset594(int) {
+ return offset = 594;
+ }
+
+ virtual unsigned int offset595(int) {
+ return offset = 595;
+ }
+
+ virtual unsigned int offset596(int) {
+ return offset = 596;
+ }
+
+ virtual unsigned int offset597(int) {
+ return offset = 597;
+ }
+
+ virtual unsigned int offset598(int) {
+ return offset = 598;
+ }
+
+ virtual unsigned int offset599(int) {
+ return offset = 599;
+ }
+
+
+ virtual unsigned int offset600(int) {
+ return offset = 600;
+ }
+
+ virtual unsigned int offset601(int) {
+ return offset = 601;
+ }
+
+ virtual unsigned int offset602(int) {
+ return offset = 602;
+ }
+
+ virtual unsigned int offset603(int) {
+ return offset = 603;
+ }
+
+ virtual unsigned int offset604(int) {
+ return offset = 604;
+ }
+
+ virtual unsigned int offset605(int) {
+ return offset = 605;
+ }
+
+ virtual unsigned int offset606(int) {
+ return offset = 606;
+ }
+
+ virtual unsigned int offset607(int) {
+ return offset = 607;
+ }
+
+ virtual unsigned int offset608(int) {
+ return offset = 608;
+ }
+
+ virtual unsigned int offset609(int) {
+ return offset = 609;
+ }
+
+ virtual unsigned int offset610(int) {
+ return offset = 610;
+ }
+
+ virtual unsigned int offset611(int) {
+ return offset = 611;
+ }
+
+ virtual unsigned int offset612(int) {
+ return offset = 612;
+ }
+
+ virtual unsigned int offset613(int) {
+ return offset = 613;
+ }
+
+ virtual unsigned int offset614(int) {
+ return offset = 614;
+ }
+
+ virtual unsigned int offset615(int) {
+ return offset = 615;
+ }
+
+ virtual unsigned int offset616(int) {
+ return offset = 616;
+ }
+
+ virtual unsigned int offset617(int) {
+ return offset = 617;
+ }
+
+ virtual unsigned int offset618(int) {
+ return offset = 618;
+ }
+
+ virtual unsigned int offset619(int) {
+ return offset = 619;
+ }
+
+ virtual unsigned int offset620(int) {
+ return offset = 620;
+ }
+
+ virtual unsigned int offset621(int) {
+ return offset = 621;
+ }
+
+ virtual unsigned int offset622(int) {
+ return offset = 622;
+ }
+
+ virtual unsigned int offset623(int) {
+ return offset = 623;
+ }
+
+ virtual unsigned int offset624(int) {
+ return offset = 624;
+ }
+
+ virtual unsigned int offset625(int) {
+ return offset = 625;
+ }
+
+ virtual unsigned int offset626(int) {
+ return offset = 626;
+ }
+
+ virtual unsigned int offset627(int) {
+ return offset = 627;
+ }
+
+ virtual unsigned int offset628(int) {
+ return offset = 628;
+ }
+
+ virtual unsigned int offset629(int) {
+ return offset = 629;
+ }
+
+ virtual unsigned int offset630(int) {
+ return offset = 630;
+ }
+
+ virtual unsigned int offset631(int) {
+ return offset = 631;
+ }
+
+ virtual unsigned int offset632(int) {
+ return offset = 632;
+ }
+
+ virtual unsigned int offset633(int) {
+ return offset = 633;
+ }
+
+ virtual unsigned int offset634(int) {
+ return offset = 634;
+ }
+
+ virtual unsigned int offset635(int) {
+ return offset = 635;
+ }
+
+ virtual unsigned int offset636(int) {
+ return offset = 636;
+ }
+
+ virtual unsigned int offset637(int) {
+ return offset = 637;
+ }
+
+ virtual unsigned int offset638(int) {
+ return offset = 638;
+ }
+
+ virtual unsigned int offset639(int) {
+ return offset = 639;
+ }
+
+ virtual unsigned int offset640(int) {
+ return offset = 640;
+ }
+
+ virtual unsigned int offset641(int) {
+ return offset = 641;
+ }
+
+ virtual unsigned int offset642(int) {
+ return offset = 642;
+ }
+
+ virtual unsigned int offset643(int) {
+ return offset = 643;
+ }
+
+ virtual unsigned int offset644(int) {
+ return offset = 644;
+ }
+
+ virtual unsigned int offset645(int) {
+ return offset = 645;
+ }
+
+ virtual unsigned int offset646(int) {
+ return offset = 646;
+ }
+
+ virtual unsigned int offset647(int) {
+ return offset = 647;
+ }
+
+ virtual unsigned int offset648(int) {
+ return offset = 648;
+ }
+
+ virtual unsigned int offset649(int) {
+ return offset = 649;
+ }
+
+ virtual unsigned int offset650(int) {
+ return offset = 650;
+ }
+
+ virtual unsigned int offset651(int) {
+ return offset = 651;
+ }
+
+ virtual unsigned int offset652(int) {
+ return offset = 652;
+ }
+
+ virtual unsigned int offset653(int) {
+ return offset = 653;
+ }
+
+ virtual unsigned int offset654(int) {
+ return offset = 654;
+ }
+
+ virtual unsigned int offset655(int) {
+ return offset = 655;
+ }
+
+ virtual unsigned int offset656(int) {
+ return offset = 656;
+ }
+
+ virtual unsigned int offset657(int) {
+ return offset = 657;
+ }
+
+ virtual unsigned int offset658(int) {
+ return offset = 658;
+ }
+
+ virtual unsigned int offset659(int) {
+ return offset = 659;
+ }
+
+ virtual unsigned int offset660(int) {
+ return offset = 660;
+ }
+
+ virtual unsigned int offset661(int) {
+ return offset = 661;
+ }
+
+ virtual unsigned int offset662(int) {
+ return offset = 662;
+ }
+
+ virtual unsigned int offset663(int) {
+ return offset = 663;
+ }
+
+ virtual unsigned int offset664(int) {
+ return offset = 664;
+ }
+
+ virtual unsigned int offset665(int) {
+ return offset = 665;
+ }
+
+ virtual unsigned int offset666(int) {
+ return offset = 666;
+ }
+
+ virtual unsigned int offset667(int) {
+ return offset = 667;
+ }
+
+ virtual unsigned int offset668(int) {
+ return offset = 668;
+ }
+
+ virtual unsigned int offset669(int) {
+ return offset = 669;
+ }
+
+ virtual unsigned int offset670(int) {
+ return offset = 670;
+ }
+
+ virtual unsigned int offset671(int) {
+ return offset = 671;
+ }
+
+ virtual unsigned int offset672(int) {
+ return offset = 672;
+ }
+
+ virtual unsigned int offset673(int) {
+ return offset = 673;
+ }
+
+ virtual unsigned int offset674(int) {
+ return offset = 674;
+ }
+
+ virtual unsigned int offset675(int) {
+ return offset = 675;
+ }
+
+ virtual unsigned int offset676(int) {
+ return offset = 676;
+ }
+
+ virtual unsigned int offset677(int) {
+ return offset = 677;
+ }
+
+ virtual unsigned int offset678(int) {
+ return offset = 678;
+ }
+
+ virtual unsigned int offset679(int) {
+ return offset = 679;
+ }
+
+ virtual unsigned int offset680(int) {
+ return offset = 680;
+ }
+
+ virtual unsigned int offset681(int) {
+ return offset = 681;
+ }
+
+ virtual unsigned int offset682(int) {
+ return offset = 682;
+ }
+
+ virtual unsigned int offset683(int) {
+ return offset = 683;
+ }
+
+ virtual unsigned int offset684(int) {
+ return offset = 684;
+ }
+
+ virtual unsigned int offset685(int) {
+ return offset = 685;
+ }
+
+ virtual unsigned int offset686(int) {
+ return offset = 686;
+ }
+
+ virtual unsigned int offset687(int) {
+ return offset = 687;
+ }
+
+ virtual unsigned int offset688(int) {
+ return offset = 688;
+ }
+
+ virtual unsigned int offset689(int) {
+ return offset = 689;
+ }
+
+ virtual unsigned int offset690(int) {
+ return offset = 690;
+ }
+
+ virtual unsigned int offset691(int) {
+ return offset = 691;
+ }
+
+ virtual unsigned int offset692(int) {
+ return offset = 692;
+ }
+
+ virtual unsigned int offset693(int) {
+ return offset = 693;
+ }
+
+ virtual unsigned int offset694(int) {
+ return offset = 694;
+ }
+
+ virtual unsigned int offset695(int) {
+ return offset = 695;
+ }
+
+ virtual unsigned int offset696(int) {
+ return offset = 696;
+ }
+
+ virtual unsigned int offset697(int) {
+ return offset = 697;
+ }
+
+ virtual unsigned int offset698(int) {
+ return offset = 698;
+ }
+
+ virtual unsigned int offset699(int) {
+ return offset = 699;
+ }
+
+
+ virtual unsigned int offset700(int) {
+ return offset = 700;
+ }
+
+ virtual unsigned int offset701(int) {
+ return offset = 701;
+ }
+
+ virtual unsigned int offset702(int) {
+ return offset = 702;
+ }
+
+ virtual unsigned int offset703(int) {
+ return offset = 703;
+ }
+
+ virtual unsigned int offset704(int) {
+ return offset = 704;
+ }
+
+ virtual unsigned int offset705(int) {
+ return offset = 705;
+ }
+
+ virtual unsigned int offset706(int) {
+ return offset = 706;
+ }
+
+ virtual unsigned int offset707(int) {
+ return offset = 707;
+ }
+
+ virtual unsigned int offset708(int) {
+ return offset = 708;
+ }
+
+ virtual unsigned int offset709(int) {
+ return offset = 709;
+ }
+
+ virtual unsigned int offset710(int) {
+ return offset = 710;
+ }
+
+ virtual unsigned int offset711(int) {
+ return offset = 711;
+ }
+
+ virtual unsigned int offset712(int) {
+ return offset = 712;
+ }
+
+ virtual unsigned int offset713(int) {
+ return offset = 713;
+ }
+
+ virtual unsigned int offset714(int) {
+ return offset = 714;
+ }
+
+ virtual unsigned int offset715(int) {
+ return offset = 715;
+ }
+
+ virtual unsigned int offset716(int) {
+ return offset = 716;
+ }
+
+ virtual unsigned int offset717(int) {
+ return offset = 717;
+ }
+
+ virtual unsigned int offset718(int) {
+ return offset = 718;
+ }
+
+ virtual unsigned int offset719(int) {
+ return offset = 719;
+ }
+
+ virtual unsigned int offset720(int) {
+ return offset = 720;
+ }
+
+ virtual unsigned int offset721(int) {
+ return offset = 721;
+ }
+
+ virtual unsigned int offset722(int) {
+ return offset = 722;
+ }
+
+ virtual unsigned int offset723(int) {
+ return offset = 723;
+ }
+
+ virtual unsigned int offset724(int) {
+ return offset = 724;
+ }
+
+ virtual unsigned int offset725(int) {
+ return offset = 725;
+ }
+
+ virtual unsigned int offset726(int) {
+ return offset = 726;
+ }
+
+ virtual unsigned int offset727(int) {
+ return offset = 727;
+ }
+
+ virtual unsigned int offset728(int) {
+ return offset = 728;
+ }
+
+ virtual unsigned int offset729(int) {
+ return offset = 729;
+ }
+
+ virtual unsigned int offset730(int) {
+ return offset = 730;
+ }
+
+ virtual unsigned int offset731(int) {
+ return offset = 731;
+ }
+
+ virtual unsigned int offset732(int) {
+ return offset = 732;
+ }
+
+ virtual unsigned int offset733(int) {
+ return offset = 733;
+ }
+
+ virtual unsigned int offset734(int) {
+ return offset = 734;
+ }
+
+ virtual unsigned int offset735(int) {
+ return offset = 735;
+ }
+
+ virtual unsigned int offset736(int) {
+ return offset = 736;
+ }
+
+ virtual unsigned int offset737(int) {
+ return offset = 737;
+ }
+
+ virtual unsigned int offset738(int) {
+ return offset = 738;
+ }
+
+ virtual unsigned int offset739(int) {
+ return offset = 739;
+ }
+
+ virtual unsigned int offset740(int) {
+ return offset = 740;
+ }
+
+ virtual unsigned int offset741(int) {
+ return offset = 741;
+ }
+
+ virtual unsigned int offset742(int) {
+ return offset = 742;
+ }
+
+ virtual unsigned int offset743(int) {
+ return offset = 743;
+ }
+
+ virtual unsigned int offset744(int) {
+ return offset = 744;
+ }
+
+ virtual unsigned int offset745(int) {
+ return offset = 745;
+ }
+
+ virtual unsigned int offset746(int) {
+ return offset = 746;
+ }
+
+ virtual unsigned int offset747(int) {
+ return offset = 747;
+ }
+
+ virtual unsigned int offset748(int) {
+ return offset = 748;
+ }
+
+ virtual unsigned int offset749(int) {
+ return offset = 749;
+ }
+
+ virtual unsigned int offset750(int) {
+ return offset = 750;
+ }
+
+ virtual unsigned int offset751(int) {
+ return offset = 751;
+ }
+
+ virtual unsigned int offset752(int) {
+ return offset = 752;
+ }
+
+ virtual unsigned int offset753(int) {
+ return offset = 753;
+ }
+
+ virtual unsigned int offset754(int) {
+ return offset = 754;
+ }
+
+ virtual unsigned int offset755(int) {
+ return offset = 755;
+ }
+
+ virtual unsigned int offset756(int) {
+ return offset = 756;
+ }
+
+ virtual unsigned int offset757(int) {
+ return offset = 757;
+ }
+
+ virtual unsigned int offset758(int) {
+ return offset = 758;
+ }
+
+ virtual unsigned int offset759(int) {
+ return offset = 759;
+ }
+
+ virtual unsigned int offset760(int) {
+ return offset = 760;
+ }
+
+ virtual unsigned int offset761(int) {
+ return offset = 761;
+ }
+
+ virtual unsigned int offset762(int) {
+ return offset = 762;
+ }
+
+ virtual unsigned int offset763(int) {
+ return offset = 763;
+ }
+
+ virtual unsigned int offset764(int) {
+ return offset = 764;
+ }
+
+ virtual unsigned int offset765(int) {
+ return offset = 765;
+ }
+
+ virtual unsigned int offset766(int) {
+ return offset = 766;
+ }
+
+ virtual unsigned int offset767(int) {
+ return offset = 767;
+ }
+
+ virtual unsigned int offset768(int) {
+ return offset = 768;
+ }
+
+ virtual unsigned int offset769(int) {
+ return offset = 769;
+ }
+
+ virtual unsigned int offset770(int) {
+ return offset = 770;
+ }
+
+ virtual unsigned int offset771(int) {
+ return offset = 771;
+ }
+
+ virtual unsigned int offset772(int) {
+ return offset = 772;
+ }
+
+ virtual unsigned int offset773(int) {
+ return offset = 773;
+ }
+
+ virtual unsigned int offset774(int) {
+ return offset = 774;
+ }
+
+ virtual unsigned int offset775(int) {
+ return offset = 775;
+ }
+
+ virtual unsigned int offset776(int) {
+ return offset = 776;
+ }
+
+ virtual unsigned int offset777(int) {
+ return offset = 777;
+ }
+
+ virtual unsigned int offset778(int) {
+ return offset = 778;
+ }
+
+ virtual unsigned int offset779(int) {
+ return offset = 779;
+ }
+
+ virtual unsigned int offset780(int) {
+ return offset = 780;
+ }
+
+ virtual unsigned int offset781(int) {
+ return offset = 781;
+ }
+
+ virtual unsigned int offset782(int) {
+ return offset = 782;
+ }
+
+ virtual unsigned int offset783(int) {
+ return offset = 783;
+ }
+
+ virtual unsigned int offset784(int) {
+ return offset = 784;
+ }
+
+ virtual unsigned int offset785(int) {
+ return offset = 785;
+ }
+
+ virtual unsigned int offset786(int) {
+ return offset = 786;
+ }
+
+ virtual unsigned int offset787(int) {
+ return offset = 787;
+ }
+
+ virtual unsigned int offset788(int) {
+ return offset = 788;
+ }
+
+ virtual unsigned int offset789(int) {
+ return offset = 789;
+ }
+
+ virtual unsigned int offset790(int) {
+ return offset = 790;
+ }
+
+ virtual unsigned int offset791(int) {
+ return offset = 791;
+ }
+
+ virtual unsigned int offset792(int) {
+ return offset = 792;
+ }
+
+ virtual unsigned int offset793(int) {
+ return offset = 793;
+ }
+
+ virtual unsigned int offset794(int) {
+ return offset = 794;
+ }
+
+ virtual unsigned int offset795(int) {
+ return offset = 795;
+ }
+
+ virtual unsigned int offset796(int) {
+ return offset = 796;
+ }
+
+ virtual unsigned int offset797(int) {
+ return offset = 797;
+ }
+
+ virtual unsigned int offset798(int) {
+ return offset = 798;
+ }
+
+ virtual unsigned int offset799(int) {
+ return offset = 799;
+ }
+
+
+ virtual unsigned int offset800(int) {
+ return offset = 800;
+ }
+
+ virtual unsigned int offset801(int) {
+ return offset = 801;
+ }
+
+ virtual unsigned int offset802(int) {
+ return offset = 802;
+ }
+
+ virtual unsigned int offset803(int) {
+ return offset = 803;
+ }
+
+ virtual unsigned int offset804(int) {
+ return offset = 804;
+ }
+
+ virtual unsigned int offset805(int) {
+ return offset = 805;
+ }
+
+ virtual unsigned int offset806(int) {
+ return offset = 806;
+ }
+
+ virtual unsigned int offset807(int) {
+ return offset = 807;
+ }
+
+ virtual unsigned int offset808(int) {
+ return offset = 808;
+ }
+
+ virtual unsigned int offset809(int) {
+ return offset = 809;
+ }
+
+ virtual unsigned int offset810(int) {
+ return offset = 810;
+ }
+
+ virtual unsigned int offset811(int) {
+ return offset = 811;
+ }
+
+ virtual unsigned int offset812(int) {
+ return offset = 812;
+ }
+
+ virtual unsigned int offset813(int) {
+ return offset = 813;
+ }
+
+ virtual unsigned int offset814(int) {
+ return offset = 814;
+ }
+
+ virtual unsigned int offset815(int) {
+ return offset = 815;
+ }
+
+ virtual unsigned int offset816(int) {
+ return offset = 816;
+ }
+
+ virtual unsigned int offset817(int) {
+ return offset = 817;
+ }
+
+ virtual unsigned int offset818(int) {
+ return offset = 818;
+ }
+
+ virtual unsigned int offset819(int) {
+ return offset = 819;
+ }
+
+ virtual unsigned int offset820(int) {
+ return offset = 820;
+ }
+
+ virtual unsigned int offset821(int) {
+ return offset = 821;
+ }
+
+ virtual unsigned int offset822(int) {
+ return offset = 822;
+ }
+
+ virtual unsigned int offset823(int) {
+ return offset = 823;
+ }
+
+ virtual unsigned int offset824(int) {
+ return offset = 824;
+ }
+
+ virtual unsigned int offset825(int) {
+ return offset = 825;
+ }
+
+ virtual unsigned int offset826(int) {
+ return offset = 826;
+ }
+
+ virtual unsigned int offset827(int) {
+ return offset = 827;
+ }
+
+ virtual unsigned int offset828(int) {
+ return offset = 828;
+ }
+
+ virtual unsigned int offset829(int) {
+ return offset = 829;
+ }
+
+ virtual unsigned int offset830(int) {
+ return offset = 830;
+ }
+
+ virtual unsigned int offset831(int) {
+ return offset = 831;
+ }
+
+ virtual unsigned int offset832(int) {
+ return offset = 832;
+ }
+
+ virtual unsigned int offset833(int) {
+ return offset = 833;
+ }
+
+ virtual unsigned int offset834(int) {
+ return offset = 834;
+ }
+
+ virtual unsigned int offset835(int) {
+ return offset = 835;
+ }
+
+ virtual unsigned int offset836(int) {
+ return offset = 836;
+ }
+
+ virtual unsigned int offset837(int) {
+ return offset = 837;
+ }
+
+ virtual unsigned int offset838(int) {
+ return offset = 838;
+ }
+
+ virtual unsigned int offset839(int) {
+ return offset = 839;
+ }
+
+ virtual unsigned int offset840(int) {
+ return offset = 840;
+ }
+
+ virtual unsigned int offset841(int) {
+ return offset = 841;
+ }
+
+ virtual unsigned int offset842(int) {
+ return offset = 842;
+ }
+
+ virtual unsigned int offset843(int) {
+ return offset = 843;
+ }
+
+ virtual unsigned int offset844(int) {
+ return offset = 844;
+ }
+
+ virtual unsigned int offset845(int) {
+ return offset = 845;
+ }
+
+ virtual unsigned int offset846(int) {
+ return offset = 846;
+ }
+
+ virtual unsigned int offset847(int) {
+ return offset = 847;
+ }
+
+ virtual unsigned int offset848(int) {
+ return offset = 848;
+ }
+
+ virtual unsigned int offset849(int) {
+ return offset = 849;
+ }
+
+ virtual unsigned int offset850(int) {
+ return offset = 850;
+ }
+
+ virtual unsigned int offset851(int) {
+ return offset = 851;
+ }
+
+ virtual unsigned int offset852(int) {
+ return offset = 852;
+ }
+
+ virtual unsigned int offset853(int) {
+ return offset = 853;
+ }
+
+ virtual unsigned int offset854(int) {
+ return offset = 854;
+ }
+
+ virtual unsigned int offset855(int) {
+ return offset = 855;
+ }
+
+ virtual unsigned int offset856(int) {
+ return offset = 856;
+ }
+
+ virtual unsigned int offset857(int) {
+ return offset = 857;
+ }
+
+ virtual unsigned int offset858(int) {
+ return offset = 858;
+ }
+
+ virtual unsigned int offset859(int) {
+ return offset = 859;
+ }
+
+ virtual unsigned int offset860(int) {
+ return offset = 860;
+ }
+
+ virtual unsigned int offset861(int) {
+ return offset = 861;
+ }
+
+ virtual unsigned int offset862(int) {
+ return offset = 862;
+ }
+
+ virtual unsigned int offset863(int) {
+ return offset = 863;
+ }
+
+ virtual unsigned int offset864(int) {
+ return offset = 864;
+ }
+
+ virtual unsigned int offset865(int) {
+ return offset = 865;
+ }
+
+ virtual unsigned int offset866(int) {
+ return offset = 866;
+ }
+
+ virtual unsigned int offset867(int) {
+ return offset = 867;
+ }
+
+ virtual unsigned int offset868(int) {
+ return offset = 868;
+ }
+
+ virtual unsigned int offset869(int) {
+ return offset = 869;
+ }
+
+ virtual unsigned int offset870(int) {
+ return offset = 870;
+ }
+
+ virtual unsigned int offset871(int) {
+ return offset = 871;
+ }
+
+ virtual unsigned int offset872(int) {
+ return offset = 872;
+ }
+
+ virtual unsigned int offset873(int) {
+ return offset = 873;
+ }
+
+ virtual unsigned int offset874(int) {
+ return offset = 874;
+ }
+
+ virtual unsigned int offset875(int) {
+ return offset = 875;
+ }
+
+ virtual unsigned int offset876(int) {
+ return offset = 876;
+ }
+
+ virtual unsigned int offset877(int) {
+ return offset = 877;
+ }
+
+ virtual unsigned int offset878(int) {
+ return offset = 878;
+ }
+
+ virtual unsigned int offset879(int) {
+ return offset = 879;
+ }
+
+ virtual unsigned int offset880(int) {
+ return offset = 880;
+ }
+
+ virtual unsigned int offset881(int) {
+ return offset = 881;
+ }
+
+ virtual unsigned int offset882(int) {
+ return offset = 882;
+ }
+
+ virtual unsigned int offset883(int) {
+ return offset = 883;
+ }
+
+ virtual unsigned int offset884(int) {
+ return offset = 884;
+ }
+
+ virtual unsigned int offset885(int) {
+ return offset = 885;
+ }
+
+ virtual unsigned int offset886(int) {
+ return offset = 886;
+ }
+
+ virtual unsigned int offset887(int) {
+ return offset = 887;
+ }
+
+ virtual unsigned int offset888(int) {
+ return offset = 888;
+ }
+
+ virtual unsigned int offset889(int) {
+ return offset = 889;
+ }
+
+ virtual unsigned int offset890(int) {
+ return offset = 890;
+ }
+
+ virtual unsigned int offset891(int) {
+ return offset = 891;
+ }
+
+ virtual unsigned int offset892(int) {
+ return offset = 892;
+ }
+
+ virtual unsigned int offset893(int) {
+ return offset = 893;
+ }
+
+ virtual unsigned int offset894(int) {
+ return offset = 894;
+ }
+
+ virtual unsigned int offset895(int) {
+ return offset = 895;
+ }
+
+ virtual unsigned int offset896(int) {
+ return offset = 896;
+ }
+
+ virtual unsigned int offset897(int) {
+ return offset = 897;
+ }
+
+ virtual unsigned int offset898(int) {
+ return offset = 898;
+ }
+
+ virtual unsigned int offset899(int) {
+ return offset = 899;
+ }
+
+
+ virtual unsigned int offset900(int) {
+ return offset = 900;
+ }
+
+ virtual unsigned int offset901(int) {
+ return offset = 901;
+ }
+
+ virtual unsigned int offset902(int) {
+ return offset = 902;
+ }
+
+ virtual unsigned int offset903(int) {
+ return offset = 903;
+ }
+
+ virtual unsigned int offset904(int) {
+ return offset = 904;
+ }
+
+ virtual unsigned int offset905(int) {
+ return offset = 905;
+ }
+
+ virtual unsigned int offset906(int) {
+ return offset = 906;
+ }
+
+ virtual unsigned int offset907(int) {
+ return offset = 907;
+ }
+
+ virtual unsigned int offset908(int) {
+ return offset = 908;
+ }
+
+ virtual unsigned int offset909(int) {
+ return offset = 909;
+ }
+
+ virtual unsigned int offset910(int) {
+ return offset = 910;
+ }
+
+ virtual unsigned int offset911(int) {
+ return offset = 911;
+ }
+
+ virtual unsigned int offset912(int) {
+ return offset = 912;
+ }
+
+ virtual unsigned int offset913(int) {
+ return offset = 913;
+ }
+
+ virtual unsigned int offset914(int) {
+ return offset = 914;
+ }
+
+ virtual unsigned int offset915(int) {
+ return offset = 915;
+ }
+
+ virtual unsigned int offset916(int) {
+ return offset = 916;
+ }
+
+ virtual unsigned int offset917(int) {
+ return offset = 917;
+ }
+
+ virtual unsigned int offset918(int) {
+ return offset = 918;
+ }
+
+ virtual unsigned int offset919(int) {
+ return offset = 919;
+ }
+
+ virtual unsigned int offset920(int) {
+ return offset = 920;
+ }
+
+ virtual unsigned int offset921(int) {
+ return offset = 921;
+ }
+
+ virtual unsigned int offset922(int) {
+ return offset = 922;
+ }
+
+ virtual unsigned int offset923(int) {
+ return offset = 923;
+ }
+
+ virtual unsigned int offset924(int) {
+ return offset = 924;
+ }
+
+ virtual unsigned int offset925(int) {
+ return offset = 925;
+ }
+
+ virtual unsigned int offset926(int) {
+ return offset = 926;
+ }
+
+ virtual unsigned int offset927(int) {
+ return offset = 927;
+ }
+
+ virtual unsigned int offset928(int) {
+ return offset = 928;
+ }
+
+ virtual unsigned int offset929(int) {
+ return offset = 929;
+ }
+
+ virtual unsigned int offset930(int) {
+ return offset = 930;
+ }
+
+ virtual unsigned int offset931(int) {
+ return offset = 931;
+ }
+
+ virtual unsigned int offset932(int) {
+ return offset = 932;
+ }
+
+ virtual unsigned int offset933(int) {
+ return offset = 933;
+ }
+
+ virtual unsigned int offset934(int) {
+ return offset = 934;
+ }
+
+ virtual unsigned int offset935(int) {
+ return offset = 935;
+ }
+
+ virtual unsigned int offset936(int) {
+ return offset = 936;
+ }
+
+ virtual unsigned int offset937(int) {
+ return offset = 937;
+ }
+
+ virtual unsigned int offset938(int) {
+ return offset = 938;
+ }
+
+ virtual unsigned int offset939(int) {
+ return offset = 939;
+ }
+
+ virtual unsigned int offset940(int) {
+ return offset = 940;
+ }
+
+ virtual unsigned int offset941(int) {
+ return offset = 941;
+ }
+
+ virtual unsigned int offset942(int) {
+ return offset = 942;
+ }
+
+ virtual unsigned int offset943(int) {
+ return offset = 943;
+ }
+
+ virtual unsigned int offset944(int) {
+ return offset = 944;
+ }
+
+ virtual unsigned int offset945(int) {
+ return offset = 945;
+ }
+
+ virtual unsigned int offset946(int) {
+ return offset = 946;
+ }
+
+ virtual unsigned int offset947(int) {
+ return offset = 947;
+ }
+
+ virtual unsigned int offset948(int) {
+ return offset = 948;
+ }
+
+ virtual unsigned int offset949(int) {
+ return offset = 949;
+ }
+
+ virtual unsigned int offset950(int) {
+ return offset = 950;
+ }
+
+ virtual unsigned int offset951(int) {
+ return offset = 951;
+ }
+
+ virtual unsigned int offset952(int) {
+ return offset = 952;
+ }
+
+ virtual unsigned int offset953(int) {
+ return offset = 953;
+ }
+
+ virtual unsigned int offset954(int) {
+ return offset = 954;
+ }
+
+ virtual unsigned int offset955(int) {
+ return offset = 955;
+ }
+
+ virtual unsigned int offset956(int) {
+ return offset = 956;
+ }
+
+ virtual unsigned int offset957(int) {
+ return offset = 957;
+ }
+
+ virtual unsigned int offset958(int) {
+ return offset = 958;
+ }
+
+ virtual unsigned int offset959(int) {
+ return offset = 959;
+ }
+
+ virtual unsigned int offset960(int) {
+ return offset = 960;
+ }
+
+ virtual unsigned int offset961(int) {
+ return offset = 961;
+ }
+
+ virtual unsigned int offset962(int) {
+ return offset = 962;
+ }
+
+ virtual unsigned int offset963(int) {
+ return offset = 963;
+ }
+
+ virtual unsigned int offset964(int) {
+ return offset = 964;
+ }
+
+ virtual unsigned int offset965(int) {
+ return offset = 965;
+ }
+
+ virtual unsigned int offset966(int) {
+ return offset = 966;
+ }
+
+ virtual unsigned int offset967(int) {
+ return offset = 967;
+ }
+
+ virtual unsigned int offset968(int) {
+ return offset = 968;
+ }
+
+ virtual unsigned int offset969(int) {
+ return offset = 969;
+ }
+
+ virtual unsigned int offset970(int) {
+ return offset = 970;
+ }
+
+ virtual unsigned int offset971(int) {
+ return offset = 971;
+ }
+
+ virtual unsigned int offset972(int) {
+ return offset = 972;
+ }
+
+ virtual unsigned int offset973(int) {
+ return offset = 973;
+ }
+
+ virtual unsigned int offset974(int) {
+ return offset = 974;
+ }
+
+ virtual unsigned int offset975(int) {
+ return offset = 975;
+ }
+
+ virtual unsigned int offset976(int) {
+ return offset = 976;
+ }
+
+ virtual unsigned int offset977(int) {
+ return offset = 977;
+ }
+
+ virtual unsigned int offset978(int) {
+ return offset = 978;
+ }
+
+ virtual unsigned int offset979(int) {
+ return offset = 979;
+ }
+
+ virtual unsigned int offset980(int) {
+ return offset = 980;
+ }
+
+ virtual unsigned int offset981(int) {
+ return offset = 981;
+ }
+
+ virtual unsigned int offset982(int) {
+ return offset = 982;
+ }
+
+ virtual unsigned int offset983(int) {
+ return offset = 983;
+ }
+
+ virtual unsigned int offset984(int) {
+ return offset = 984;
+ }
+
+ virtual unsigned int offset985(int) {
+ return offset = 985;
+ }
+
+ virtual unsigned int offset986(int) {
+ return offset = 986;
+ }
+
+ virtual unsigned int offset987(int) {
+ return offset = 987;
+ }
+
+ virtual unsigned int offset988(int) {
+ return offset = 988;
+ }
+
+ virtual unsigned int offset989(int) {
+ return offset = 989;
+ }
+
+ virtual unsigned int offset990(int) {
+ return offset = 990;
+ }
+
+ virtual unsigned int offset991(int) {
+ return offset = 991;
+ }
+
+ virtual unsigned int offset992(int) {
+ return offset = 992;
+ }
+
+ virtual unsigned int offset993(int) {
+ return offset = 993;
+ }
+
+ virtual unsigned int offset994(int) {
+ return offset = 994;
+ }
+
+ virtual unsigned int offset995(int) {
+ return offset = 995;
+ }
+
+ virtual unsigned int offset996(int) {
+ return offset = 996;
+ }
+
+ virtual unsigned int offset997(int) {
+ return offset = 997;
+ }
+
+ virtual unsigned int offset998(int) {
+ return offset = 998;
+ }
+
+ virtual unsigned int offset999(int) {
+ return offset = 999;
+ }
+
+ virtual unsigned int offset1000(int) {
+ return offset = 1000;
+ }
+
+ };
+}
+namespace fakeit {
+
+ template
+ TARGET union_cast(SOURCE source) {
+
+ union {
+ SOURCE source;
+ TARGET target;
+ } u;
+ u.source = source;
+ return u.target;
+ }
+
+}
+
+namespace fakeit {
+ class NoVirtualDtor {
+ };
+
+ class VTUtils {
+ public:
+
+ template
+ static unsigned int getOffset(R (C::*vMethod)(arglist...)) {
+ auto sMethod = reinterpret_cast(vMethod);
+ VirtualOffsetSelector offsetSelctor;
+ return (offsetSelctor.*sMethod)(0);
+ }
+
+ template
+ static typename std::enable_if::value, unsigned int>::type
+ getDestructorOffset() {
+ VirtualOffsetSelector offsetSelctor;
+ union_cast(&offsetSelctor)->~C();
+ return offsetSelctor.offset;
+ }
+
+ template
+ static typename std::enable_if::value, unsigned int>::type
+ getDestructorOffset() {
+ throw NoVirtualDtor();
+ }
+
+ template
+ static unsigned int getVTSize() {
+ struct Derrived : public C {
+ virtual void endOfVt() {
+ }
+ };
+
+ unsigned int vtSize = getOffset(&Derrived::endOfVt);
+ return vtSize;
+ }
+ };
+
+
+}
+#ifdef _MSC_VER
+namespace fakeit {
+
+ typedef unsigned long DWORD;
+
+ struct TypeDescriptor {
+ TypeDescriptor() :
+ ptrToVTable(0), spare(0) {
+
+ int **tiVFTPtr = (int **) (&typeid(void));
+ int *i = (int *) tiVFTPtr[0];
+ char *type_info_vft_ptr = (char *) i;
+ ptrToVTable = type_info_vft_ptr;
+ }
+
+ char *ptrToVTable;
+ DWORD spare;
+ char name[8];
+ };
+
+ struct PMD {
+
+
+
+ int mdisp;
+
+ int pdisp;
+ int vdisp;
+
+ PMD() :
+ mdisp(0), pdisp(-1), vdisp(0) {
+ }
+ };
+
+ struct RTTIBaseClassDescriptor {
+ RTTIBaseClassDescriptor() :
+ pTypeDescriptor(nullptr), numContainedBases(0), attributes(0) {
+ }
+
+ const std::type_info *pTypeDescriptor;
+ DWORD numContainedBases;
+ struct PMD where;
+ DWORD attributes;
+ };
+
+ template
+ struct RTTIClassHierarchyDescriptor {
+ RTTIClassHierarchyDescriptor() :
+ signature(0),
+ attributes(0),
+ numBaseClasses(0),
+ pBaseClassArray(nullptr) {
+ pBaseClassArray = new RTTIBaseClassDescriptor *[1 + sizeof...(baseclasses)];
+ addBaseClass < C, baseclasses...>();
+ }
+
+ ~RTTIClassHierarchyDescriptor() {
+ for (int i = 0; i < 1 + sizeof...(baseclasses); i++) {
+ RTTIBaseClassDescriptor *desc = pBaseClassArray[i];
+ delete desc;
+ }
+ delete[] pBaseClassArray;
+ }
+
+ DWORD signature;
+ DWORD attributes;
+ DWORD numBaseClasses;
+ RTTIBaseClassDescriptor **pBaseClassArray;
+
+ template
+ void addBaseClass() {
+ static_assert(std::is_base_of::value, "C must be a derived class of BaseType");
+ RTTIBaseClassDescriptor *desc = new RTTIBaseClassDescriptor();
+ desc->pTypeDescriptor = &typeid(BaseType);
+ pBaseClassArray[numBaseClasses] = desc;
+ for (unsigned int i = 0; i < numBaseClasses; i++) {
+ pBaseClassArray[i]->numContainedBases++;
+ }
+ numBaseClasses++;
+ }
+
+ template
+ void addBaseClass() {
+ static_assert(std::is_base_of::value, "invalid inheritance list");
+ addBaseClass();
+ addBaseClass();
+ }
+
+ };
+
+ template
+ struct RTTICompleteObjectLocator {
+#ifdef _WIN64
+ RTTICompleteObjectLocator(const std::type_info &unused) :
+ signature(0), offset(0), cdOffset(0),
+ typeDescriptorOffset(0), classDescriptorOffset(0)
+ {
+ }
+
+ DWORD signature;
+ DWORD offset;
+ DWORD cdOffset;
+ DWORD typeDescriptorOffset;
+ DWORD classDescriptorOffset;
+#else
+ RTTICompleteObjectLocator(const std::type_info &info) :
+ signature(0), offset(0), cdOffset(0),
+ pTypeDescriptor(&info),
+ pClassDescriptor(new RTTIClassHierarchyDescriptor()) {
+ }
+
+ ~RTTICompleteObjectLocator() {
+ delete pClassDescriptor;
+ }
+
+ DWORD signature;
+ DWORD offset;
+ DWORD cdOffset;
+ const std::type_info *pTypeDescriptor;
+ struct RTTIClassHierarchyDescriptor *pClassDescriptor;
+#endif
+ };
+
+
+ struct VirtualTableBase {
+
+ static VirtualTableBase &getVTable(void *instance) {
+ fakeit::VirtualTableBase *vt = (fakeit::VirtualTableBase *) (instance);
+ return *vt;
+ }
+
+ VirtualTableBase(void **firstMethod) : _firstMethod(firstMethod) { }
+
+ void *getCookie(int index) {
+ return _firstMethod[-2 - index];
+ }
+
+ void setCookie(int index, void *value) {
+ _firstMethod[-2 - index] = value;
+ }
+
+ void *getMethod(unsigned int index) const {
+ return _firstMethod[index];
+ }
+
+ void setMethod(unsigned int index, void *method) {
+ _firstMethod[index] = method;
+ }
+
+ protected:
+ void **_firstMethod;
+ };
+
+ template
+ struct VirtualTable : public VirtualTableBase {
+
+ class Handle {
+
+ friend struct VirtualTable;
+
+ void **firstMethod;
+
+ Handle(void **method) : firstMethod(method) { }
+
+ public:
+
+ VirtualTable &restore() {
+ VirtualTable *vt = (VirtualTable *) this;
+ return *vt;
+ }
+ };
+
+ static VirtualTable &getVTable(C &instance) {
+ fakeit::VirtualTable *vt = (fakeit::VirtualTable *) (&instance);
+ return *vt;
+ }
+
+ void copyFrom(VirtualTable &from) {
+ unsigned int size = VTUtils::getVTSize();
+ for (unsigned int i = 0; i < size; i++) {
+ _firstMethod[i] = from.getMethod(i);
+ }
+ }
+
+ VirtualTable() : VirtualTable(buildVTArray()) {
+ }
+
+ ~VirtualTable() {
+
+ }
+
+ void dispose() {
+ _firstMethod--;
+ RTTICompleteObjectLocator *locator = (RTTICompleteObjectLocator *) _firstMethod[0];
+ delete locator;
+ _firstMethod -= numOfCookies;
+ delete[] _firstMethod;
+ }
+
+
+ unsigned int dtor(int) {
+ C *c = (C *) this;
+ C &cRef = *c;
+ auto vt = VirtualTable::getVTable(cRef);
+ void *dtorPtr = vt.getCookie(numOfCookies - 1);
+ void(*method)(C *) = reinterpret_cast(dtorPtr);
+ method(c);
+ return 0;
+ }
+
+ void setDtor(void *method) {
+
+
+
+
+
+ void *dtorPtr = union_cast(&VirtualTable::dtor);
+ unsigned int index = VTUtils::getDestructorOffset();
+ _firstMethod[index] = dtorPtr;
+ setCookie(numOfCookies - 1, method);
+ }
+
+ unsigned int getSize() {
+ return VTUtils::getVTSize();
+ }
+
+ void initAll(void *value) {
+ auto size = getSize();
+ for (unsigned int i = 0; i < size; i++) {
+ setMethod(i, value);
+ }
+ }
+
+ Handle createHandle() {
+ Handle h(_firstMethod);
+ return h;
+ }
+
+ private:
+
+ class SimpleType {
+ };
+
+ static_assert(sizeof(unsigned int (SimpleType::*)()) == sizeof(unsigned int (C::*)()),
+ "Can't mock a type with multiple inheritance or with non-polymorphic base class");
+ static const unsigned int numOfCookies = 3;
+
+ static void **buildVTArray() {
+ int vtSize = VTUtils::getVTSize();
+ auto array = new void *[vtSize + numOfCookies + 1]{};
+ RTTICompleteObjectLocator *objectLocator = new RTTICompleteObjectLocator(
+ typeid(C));
+ array += numOfCookies;
+ array[0] = objectLocator;
+ array++;
+ return array;
+ }
+
+ VirtualTable(void **firstMethod) : VirtualTableBase(firstMethod) {
+ }
+ };
+}
+#else
+#ifndef __clang__
+#include
+#include
+
+namespace fakeit {
+ template
+ class has_one_base {
+ };
+
+ template
+ class has_one_base> : public std::false_type {
+ };
+
+ template
+ class has_one_base>
+ : public has_one_base::type> {
+ };
+
+ template<>
+ class has_one_base> : public std::true_type {
+ };
+
+ template
+ class is_simple_inheritance_layout : public has_one_base::type> {
+ };
+}
+
+#endif
+
+namespace fakeit {
+
+ struct VirtualTableBase {
+
+ static VirtualTableBase &getVTable(void *instance) {
+ fakeit::VirtualTableBase *vt = (fakeit::VirtualTableBase *) (instance);
+ return *vt;
+ }
+
+ VirtualTableBase(void **firstMethod) : _firstMethod(firstMethod) { }
+
+ void *getCookie(int index) {
+ return _firstMethod[-3 - index];
+ }
+
+ void setCookie(int index, void *value) {
+ _firstMethod[-3 - index] = value;
+ }
+
+ void *getMethod(unsigned int index) const {
+ return _firstMethod[index];
+ }
+
+ void setMethod(unsigned int index, void *method) {
+ _firstMethod[index] = method;
+ }
+
+ protected:
+ void **_firstMethod;
+ };
+
+ template
+ struct VirtualTable : public VirtualTableBase {
+
+#ifndef __clang__
+ static_assert(is_simple_inheritance_layout::value, "Can't mock a type with multiple inheritance");
+#endif
+
+ class Handle {
+
+ friend struct VirtualTable;
+ void **firstMethod;
+
+ Handle(void **method) :
+ firstMethod(method) {
+ }
+
+ public:
+
+ VirtualTable &restore() {
+ VirtualTable *vt = (VirtualTable *) this;
+ return *vt;
+ }
+ };
+
+ static VirtualTable &getVTable(C &instance) {
+ fakeit::VirtualTable *vt = (fakeit::VirtualTable *) (&instance);
+ return *vt;
+ }
+
+ void copyFrom(VirtualTable &from) {
+ unsigned int size = VTUtils::getVTSize();
+
+ for (size_t i = 0; i < size; ++i) {
+ _firstMethod[i] = from.getMethod(i);
+ }
+ }
+
+ VirtualTable() :
+ VirtualTable(buildVTArray()) {
+ }
+
+ void dispose() {
+ _firstMethod--;
+ _firstMethod--;
+ _firstMethod -= numOfCookies;
+ delete[] _firstMethod;
+ }
+
+ unsigned int dtor(int) {
+ C *c = (C *) this;
+ C &cRef = *c;
+ auto vt = VirtualTable::getVTable(cRef);
+ unsigned int index = VTUtils::getDestructorOffset();
+ void *dtorPtr = vt.getMethod(index);
+ void(*method)(C *) = union_cast(dtorPtr);
+ method(c);
+ return 0;
+ }
+
+
+ void setDtor(void *method) {
+ unsigned int index = VTUtils::getDestructorOffset();
+ void *dtorPtr = union_cast(&VirtualTable::dtor);
+
+
+ _firstMethod[index] = method;
+
+ _firstMethod[index + 1] = dtorPtr;
+ }
+
+
+ unsigned int getSize() {
+ return VTUtils::getVTSize();
+ }
+
+ void initAll(void *value) {
+ unsigned int size = getSize();
+ for (unsigned int i = 0; i < size; i++) {
+ setMethod(i, value);
+ }
+ }
+
+ const std::type_info *getTypeId() {
+ return (const std::type_info *) (_firstMethod[-1]);
+ }
+
+ Handle createHandle() {
+ Handle h(_firstMethod);
+ return h;
+ }
+
+ private:
+ static const unsigned int numOfCookies = 2;
+
+ static void **buildVTArray() {
+ int size = VTUtils::getVTSize();
+ auto array = new void *[size + 2 + numOfCookies]{};
+ array += numOfCookies;
+ array++;
+ array[0] = const_cast(&typeid(C));
+ array++;
+ return array;
+ }
+
+ VirtualTable(void **firstMethod) : VirtualTableBase(firstMethod) {
+ }
+
+ };
+}
+#endif
+namespace fakeit {
+
+ struct NoMoreRecordedActionException {
+ };
+
+ template
+ struct MethodInvocationHandler : Destructible {
+ virtual R handleMethodInvocation(const typename fakeit::production_arg::type... args) = 0;
+ };
+
+}
+#include
+
+namespace fakeit {
+
+#ifdef __GNUG__
+#ifndef __clang__
+#pragma GCC diagnostic ignored "-Wpedantic"
+#endif
+#endif
+
+
+#ifdef _MSC_VER
+#pragma warning( push )
+#pragma warning( disable : 4200 )
+#endif
+
+
+ template
+ class FakeObject {
+
+ VirtualTable vtable;
+
+ static const size_t SIZE = sizeof(C) - sizeof(VirtualTable);
+ char instanceArea[SIZE ? SIZE : 0];
+
+ FakeObject(FakeObject const &) = delete;
+ FakeObject &operator=(FakeObject const &) = delete;
+
+ public:
+
+ FakeObject() : vtable() {
+ initializeDataMembersArea();
+ }
+
+ ~FakeObject() {
+ vtable.dispose();
+ }
+
+ void initializeDataMembersArea() {
+ for (size_t i = 0; i < SIZE; ++i) instanceArea[i] = (char) 0;
+ }
+
+ void setMethod(unsigned int index, void *method) {
+ vtable.setMethod(index, method);
+ }
+
+ VirtualTable &getVirtualTable() {
+ return vtable;
+ }
+
+ void setVirtualTable(VirtualTable &t) {
+ vtable = t;
+ }
+
+ void setDtor(void *dtor) {
+ vtable.setDtor(dtor);
+ }
+ };
+
+#ifdef _MSC_VER
+#pragma warning( pop )
+#endif
+
+#ifdef __GNUG__
+#ifndef __clang__
+#pragma GCC diagnostic pop
+#endif
+#endif
+
+}
+namespace fakeit {
+
+ struct MethodProxy {
+
+ MethodProxy(unsigned int id, unsigned int offset, void *vMethod) :
+ _id(id),
+ _offset(offset),
+ _vMethod(vMethod) {
+ }
+
+ unsigned int getOffset() const {
+ return _offset;
+ }
+
+ unsigned int getId() const {
+ return _id;
+ }
+
+ void *getProxy() const {
+ return union_cast(_vMethod);
+ }
+
+ private:
+ unsigned int _id;
+ unsigned int _offset;
+ void *_vMethod;
+ };
+}
+#include
+
+
+namespace fakeit {
+
+ struct InvocationHandlerCollection {
+ static const unsigned int VT_COOKIE_INDEX = 0;
+
+ virtual Destructible *getInvocatoinHandlerPtrById(unsigned int index) = 0;
+
+ static InvocationHandlerCollection *getInvocationHandlerCollection(void *instance) {
+ VirtualTableBase &vt = VirtualTableBase::getVTable(instance);
+ InvocationHandlerCollection *invocationHandlerCollection = (InvocationHandlerCollection *) vt.getCookie(
+ InvocationHandlerCollection::VT_COOKIE_INDEX);
+ return invocationHandlerCollection;
+ }
+ };
+
+
+ template
+ class MethodProxyCreator {
+
+
+
+ public:
+
+ template
+ MethodProxy createMethodProxy(unsigned int offset) {
+ return MethodProxy(id, offset, union_cast(&MethodProxyCreator::methodProxyX < id > ));
+ }
+
+ protected:
+
+ R methodProxy(unsigned int id, const typename fakeit::production_arg::type... args) {
+ InvocationHandlerCollection *invocationHandlerCollection = InvocationHandlerCollection::getInvocationHandlerCollection(
+ this);
+ MethodInvocationHandler *invocationHandler =
+ (MethodInvocationHandler *) invocationHandlerCollection->getInvocatoinHandlerPtrById(
+ id);
+ return invocationHandler->handleMethodInvocation(std::forward::type>(args)...);
+ }
+
+ template
+ R methodProxyX(arglist ... args) {
+ return methodProxy(id, std::forward::type>(args)...);
+ }
+ };
+}
+
+namespace fakeit {
+
+ class InvocationHandlers : public InvocationHandlerCollection {
+ std::vector> &_methodMocks;
+ std::vector &_offsets;
+
+ unsigned int getOffset(unsigned int id) const
+ {
+ unsigned int offset = 0;
+ for (; offset < _offsets.size(); offset++) {
+ if (_offsets[offset] == id) {
+ break;
+ }
+ }
+ return offset;
+ }
+
+ public:
+ InvocationHandlers(
+ std::vector> &methodMocks,
+ std::vector &offsets) :
+ _methodMocks(methodMocks), _offsets(offsets) {
+ }
+
+ Destructible *getInvocatoinHandlerPtrById(unsigned int id) override {
+ unsigned int offset = getOffset(id);
+ std::shared_ptr ptr = _methodMocks[offset];
+ return ptr.get();
+ }
+
+ };
+
+ template
+ struct DynamicProxy {
+
+ static_assert(std::is_polymorphic::value, "DynamicProxy requires a polymorphic type");
+
+ DynamicProxy(C &inst) :
+ instance(inst),
+ originalVtHandle(VirtualTable::getVTable(instance).createHandle()),
+ _methodMocks(VTUtils::getVTSize()),
+ _offsets(VTUtils::getVTSize()),
+ _invocationHandlers(_methodMocks, _offsets) {
+ _cloneVt.copyFrom(originalVtHandle.restore());
+ _cloneVt.setCookie(InvocationHandlerCollection::VT_COOKIE_INDEX, &_invocationHandlers);
+ getFake().setVirtualTable(_cloneVt);
+ }
+
+ void detach() {
+ getFake().setVirtualTable(originalVtHandle.restore());
+ }
+
+ ~DynamicProxy() {
+ _cloneVt.dispose();
+ }
+
+ C &get() {
+ return instance;
+ }
+
+ void Reset() {
+ _methodMocks = {};
+ _methodMocks.resize(VTUtils::getVTSize());
+ _members = {};
+ _offsets = {};
+ _offsets.resize(VTUtils::getVTSize());
+ _cloneVt.copyFrom(originalVtHandle.restore());
+ }
+
+ void Clear()
+ {
+ }
+
+ template
+ void stubMethod(R(C::*vMethod)(arglist...), MethodInvocationHandler *methodInvocationHandler) {
+ auto offset = VTUtils::getOffset(vMethod);
+ MethodProxyCreator creator;
+ bind(creator.template createMethodProxy(offset), methodInvocationHandler);
+ }
+
+ void stubDtor(MethodInvocationHandler *methodInvocationHandler) {
+ auto offset = VTUtils::getDestructorOffset();
+ MethodProxyCreator creator;
+ bindDtor(creator.createMethodProxy<0>(offset), methodInvocationHandler);
+ }
+
+ template
+ bool isMethodStubbed(R(C::*vMethod)(arglist...)) {
+ unsigned int offset = VTUtils::getOffset(vMethod);
+ return isBinded(offset);
+ }
+
+ bool isDtorStubbed() {
+ unsigned int offset = VTUtils::getDestructorOffset();
+ return isBinded(offset);
+ }
+
+ template
+ Destructible *getMethodMock(R(C::*vMethod)(arglist...)) {
+ auto offset = VTUtils::getOffset(vMethod);
+ std::shared_ptr ptr = _methodMocks[offset];
+ return ptr.get();
+ }
+
+ Destructible *getDtorMock() {
+ auto offset = VTUtils::getDestructorOffset