diff --git a/CMakeLists.txt b/CMakeLists.txt
index dacda6a..6bac6f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -141,7 +141,6 @@ if(BUILD_TESTS)
message("Build tests")
enable_testing()
add_subdirectory("test/Iris.Tests")
- add_subdirectory("test/AddressSanitizer.Tests")
endif()
# ---------------------------------------------------------------------------------------
diff --git a/src/CDLuminance.h b/src/CDLuminance.h
index 2ae0b60..7527a47 100644
--- a/src/CDLuminance.h
+++ b/src/CDLuminance.h
@@ -30,7 +30,7 @@ namespace iris
///
CDLuminance(EA::EACC::Utils::FrameConverter* converter, const short& fps, const cv::Size& frameSize, FlashParams* params);
void SetCurrentFrame(const IrisFrame& irisFrame) override;
- void SetCurrentFrame(cv::Mat* bgrFrame);
+ void SetCurrentFrame (cv::Mat* bgrFrame) override;
~CDLuminance();
protected:
diff --git a/src/RelativeLuminance.h b/src/RelativeLuminance.h
index 36bb878..bb6d435 100644
--- a/src/RelativeLuminance.h
+++ b/src/RelativeLuminance.h
@@ -26,7 +26,7 @@ namespace iris
void SetCurrentFrame(const IrisFrame& irisFrame) override;
- void SetCurrentFrame(cv::Mat* bgrFrame);
+ void SetCurrentFrame(cv::Mat* bgrFrame) override;
~RelativeLuminance();
protected:
diff --git a/src/TransitionTracker.h b/src/TransitionTracker.h
index 9f5805b..54881a9 100644
--- a/src/TransitionTracker.h
+++ b/src/TransitionTracker.h
@@ -14,7 +14,8 @@ namespace iris
{
public:
-
+
+ virtual ~TransitionTracker() {};
inline bool getLumPassWithWarning() { return m_luminanceResults.passWithWarning; };
inline bool getRedPassWithWarning() { return m_redResults.passWithWarning; };
@@ -52,9 +53,11 @@ namespace iris
/// If AnalysisByTime is enabled, add the first frame to the FrameTimeStamps structs
///
/// data to persist
- virtual void SetFirstFrame(FrameData& data) {return;}
+ virtual void SetFirstFrame(FrameData& data) {}
protected:
+ TransitionTracker() {};
+
struct Counter
{
std::vector count; //transition count that surpass the luminance/red threshold from the last second
diff --git a/src/TransitionTrackerByFPS.cpp b/src/TransitionTrackerByFPS.cpp
index d4e1fc8..dc00e64 100644
--- a/src/TransitionTrackerByFPS.cpp
+++ b/src/TransitionTrackerByFPS.cpp
@@ -3,6 +3,7 @@
namespace iris
{
TransitionTrackerByFPS::TransitionTrackerByFPS(unsigned int fps, TransitionTrackerParams* params)
+ : TransitionTracker()
{
m_params = params;
m_luminanceTransitionCount.count.reserve(fps); m_luminanceTransitionCount.count.emplace_back(0);
diff --git a/src/TransitionTrackerByTime.cpp b/src/TransitionTrackerByTime.cpp
index cb0a2d4..39cd8c8 100644
--- a/src/TransitionTrackerByTime.cpp
+++ b/src/TransitionTrackerByTime.cpp
@@ -2,7 +2,8 @@
namespace iris
{
- TransitionTrackerByTime::TransitionTrackerByTime(unsigned int starterFpsReserve, TransitionTrackerParams* params)
+ TransitionTrackerByTime::TransitionTrackerByTime(unsigned int starterFpsReserve, TransitionTrackerParams* params)
+ : TransitionTracker()
{
m_params = params;
m_luminanceTransitionCount.count.reserve(starterFpsReserve); m_luminanceTransitionCount.count.emplace_back(0);
@@ -39,13 +40,13 @@ namespace iris
m_fourSecondTimeStamps.GetFrameNumToRemove(data.TimeStampVal);
//update transition lists as 1s has passed
- for (m_oneSecondFramesToRemove; m_oneSecondFramesToRemove > 0; m_oneSecondFramesToRemove--)
+ for (; m_oneSecondFramesToRemove > 0; m_oneSecondFramesToRemove--)
{
m_luminanceTransitionCount.updatePassed();
m_redTransitionCount.updatePassed();
}
//update extended failure as 5s have passed
- for (m_fiveSecondFramesToRemove; m_fiveSecondFramesToRemove > 0; m_fiveSecondFramesToRemove--)
+ for (; m_fiveSecondFramesToRemove > 0; m_fiveSecondFramesToRemove--)
{
m_luminanceExtendedCount.updatePassed();
m_redExtendedCount.updatePassed();
diff --git a/test/AddressSanitizer.Tests/CMakeLists.txt b/test/AddressSanitizer.Tests/CMakeLists.txt
deleted file mode 100644
index f3496ba..0000000
--- a/test/AddressSanitizer.Tests/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-set(TEST_PROJECT AddressSanitizer.Tests)
-
-find_package(GTest CONFIG REQUIRED)
-
-add_executable(${TEST_PROJECT} "include/AddressSanitizerTest.h" "src/AddressSanitizerTest.cpp")
-
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
-set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
-
-target_link_libraries(${TEST_PROJECT} PUBLIC GTest::gtest_main PRIVATE -fsanitize=address)
-
-# add the binary tree to the search path for include files
-# so that we will find library headers
-target_include_directories(${TEST_PROJECT} PRIVATE
- "${CMAKE_CURRENT_SOURCE_DIR}/include"
- )
-
-
-include(GoogleTest)
-gtest_discover_tests(${TEST_PROJECT})
diff --git a/test/AddressSanitizer.Tests/include/AddressSanitizerTest.h b/test/AddressSanitizer.Tests/include/AddressSanitizerTest.h
deleted file mode 100644
index 646c926..0000000
--- a/test/AddressSanitizer.Tests/include/AddressSanitizerTest.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#include
-
-
-namespace AddressSanitizer::Tests
-{
-
-}
\ No newline at end of file
diff --git a/test/AddressSanitizer.Tests/src/AddressSanitizerTest.cpp b/test/AddressSanitizer.Tests/src/AddressSanitizerTest.cpp
deleted file mode 100644
index de1b7ed..0000000
--- a/test/AddressSanitizer.Tests/src/AddressSanitizerTest.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include
-#include "AddressSanitizerTest.h"
-
-namespace AddressSanitizer::Tests
-{
- TEST(AddressSanitizerTest, MemoryLeak_WhenFailed)
- {
-
- int* ptr = new int[100];
- //delete[] ptr;
-
- EXPECT_EQ(1.0f, 1.0f);
- }
-}
\ No newline at end of file
diff --git a/test/Iris.Tests/CMakeLists.txt b/test/Iris.Tests/CMakeLists.txt
index 9a350bf..f3645b6 100644
--- a/test/Iris.Tests/CMakeLists.txt
+++ b/test/Iris.Tests/CMakeLists.txt
@@ -33,7 +33,7 @@ option(ASAN_ENABLED "Build this target with AddressSanitizer" ON)
if(ASAN_ENABLED)
- if(NOT MSVC)
+ if(NOT MSVC AND NOT APPLE)
target_compile_options(${PROJECT_NAME} PUBLIC -fsanitize=address -fno-omit-frame-pointer)
target_link_options(${PROJECT_NAME} PUBLIC -fsanitize=address)
endif()
diff --git a/test/Iris.Tests/src/FlashDetectionTests.cpp b/test/Iris.Tests/src/FlashDetectionTests.cpp
index 8baf3d4..e85575c 100644
--- a/test/Iris.Tests/src/FlashDetectionTests.cpp
+++ b/test/Iris.Tests/src/FlashDetectionTests.cpp
@@ -23,11 +23,9 @@ namespace iris::Tests
TEST_F(FlashDetectionTests, RELATIVE_LUMINANCE)
{
-
configuration.SetLuminanceType(Configuration::LuminanceType::RELATIVE);
configuration.Init();
-
-
+
cv::Size size(100, 100);
cv::Mat blackFrame(size, CV_8UC3, black); //lum = 0f