Fisheye: tag bef894e38e5c1486824787cf8c47a87a0828b228 is not in file src/common/GTestMacros.h Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libchcore/GTestMacros.h'. Fisheye: No comparison available. Pass `N' to diff? Index: src/libchcore/libchcore.vc140.vcxproj =================================================================== diff -u -r776c47d61a5a67d5e2541d58013e221c685460ec -r301444777085263aae7aff911dd56722f302597e --- src/libchcore/libchcore.vc140.vcxproj (.../libchcore.vc140.vcxproj) (revision 776c47d61a5a67d5e2541d58013e221c685460ec) +++ src/libchcore/libchcore.vc140.vcxproj (.../libchcore.vc140.vcxproj) (revision 301444777085263aae7aff911dd56722f302597e) @@ -473,7 +473,7 @@ - + Index: src/libchcore/libchcore.vc140.vcxproj.filters =================================================================== diff -u -r776c47d61a5a67d5e2541d58013e221c685460ec -r301444777085263aae7aff911dd56722f302597e --- src/libchcore/libchcore.vc140.vcxproj.filters (.../libchcore.vc140.vcxproj.filters) (revision 776c47d61a5a67d5e2541d58013e221c685460ec) +++ src/libchcore/libchcore.vc140.vcxproj.filters (.../libchcore.vc140.vcxproj.filters) (revision 301444777085263aae7aff911dd56722f302597e) @@ -77,9 +77,6 @@ Source Files\Tools - - Tests - Source Files\Tools\Timers @@ -105,6 +102,9 @@ Source Files\Shared + + Tests + Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libchengine/GTestMacros.h'. Fisheye: No comparison available. Pass `N' to diff? Index: src/libchengine/TOverlappedThreadPool.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r301444777085263aae7aff911dd56722f302597e --- src/libchengine/TOverlappedThreadPool.cpp (.../TOverlappedThreadPool.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TOverlappedThreadPool.cpp (.../TOverlappedThreadPool.cpp) (revision 301444777085263aae7aff911dd56722f302597e) @@ -21,12 +21,6 @@ namespace chengine { - TOverlappedThreadPool::TOverlappedThreadPool(HANDLE hKill) : - m_threadReader(hKill), - m_threadWriter(hKill) - { - } - TReaderThread& TOverlappedThreadPool::ReaderThread() { return m_threadReader; Index: src/libchengine/TOverlappedThreadPool.h =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r301444777085263aae7aff911dd56722f302597e --- src/libchengine/TOverlappedThreadPool.h (.../TOverlappedThreadPool.h) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TOverlappedThreadPool.h (.../TOverlappedThreadPool.h) (revision 301444777085263aae7aff911dd56722f302597e) @@ -32,8 +32,6 @@ class TOverlappedThreadPool { public: - explicit TOverlappedThreadPool(HANDLE hKill); - TReaderThread& ReaderThread(); TWriterThread& WriterThread(); Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libchengine/TPlainStringPool.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libchengine/TPlainStringPool.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libchengine/TSQLiteDatabase.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libchengine/TSQLiteDatabase.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libchengine/TSQLiteException.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libchengine/TSQLiteException.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libchengine/TSQLiteStatement.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libchengine/TSQLiteStatement.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libchengine/TSQLiteTransaction.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libchengine/TSQLiteTransaction.h'. Fisheye: No comparison available. Pass `N' to diff? Index: src/libchengine/TSubTaskCopyMove.cpp =================================================================== diff -u -r85b07e753393f661f7d8f528e4238ebb6e9e1204 -r301444777085263aae7aff911dd56722f302597e --- src/libchengine/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 85b07e753393f661f7d8f528e4238ebb6e9e1204) +++ src/libchengine/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 301444777085263aae7aff911dd56722f302597e) @@ -168,7 +168,7 @@ LOG_INFO(m_spLog) << strFormat.c_str(); - TOverlappedThreadPool threadPool(rThreadController.GetKillThreadHandle()); + TOverlappedThreadPool threadPool; for(; fcIndex < fcSize; fcIndex++) { Index: src/libchengine/TThreadedQueueRunner.h =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r301444777085263aae7aff911dd56722f302597e --- src/libchengine/TThreadedQueueRunner.h (.../TThreadedQueueRunner.h) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/TThreadedQueueRunner.h (.../TThreadedQueueRunner.h) (revision 301444777085263aae7aff911dd56722f302597e) @@ -30,8 +30,7 @@ class TThreadedQueueRunner { public: - explicit TThreadedQueueRunner(HANDLE hKill) : - m_hKill(hKill), + explicit TThreadedQueueRunner() : m_eventLocalKill(true, false) { } @@ -107,7 +106,6 @@ private: WaitableQueue m_queue; std::thread m_thread; - HANDLE m_hKill = nullptr; TEvent m_eventLocalKill; }; } Index: src/libchengine/Tests/TOrderedBufferQueueTests.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r301444777085263aae7aff911dd56722f302597e --- src/libchengine/Tests/TOrderedBufferQueueTests.cpp (.../TOrderedBufferQueueTests.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/Tests/TOrderedBufferQueueTests.cpp (.../TOrderedBufferQueueTests.cpp) (revision 301444777085263aae7aff911dd56722f302597e) @@ -2,7 +2,7 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" #include "../TOrderedBufferQueue.h" -#include "../GTestMacros.h" +#include "../../common/GTestMacros.h" class FallbackCollection : public std::vector { Index: src/libchengine/Tests/TOverlappedReaderTests.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r301444777085263aae7aff911dd56722f302597e --- src/libchengine/Tests/TOverlappedReaderTests.cpp (.../TOverlappedReaderTests.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/Tests/TOverlappedReaderTests.cpp (.../TOverlappedReaderTests.cpp) (revision 301444777085263aae7aff911dd56722f302597e) @@ -3,7 +3,7 @@ #include "gmock/gmock.h" #include "../TOverlappedDataBuffer.h" #include "../../liblogger/TLogFileData.h" -#include "../GTestMacros.h" +#include "../../common/GTestMacros.h" #include "../TOverlappedMemoryPool.h" #include "../TOverlappedReader.h" Index: src/libchengine/Tests/TOverlappedWriterTests.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r301444777085263aae7aff911dd56722f302597e --- src/libchengine/Tests/TOverlappedWriterTests.cpp (.../TOverlappedWriterTests.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/Tests/TOverlappedWriterTests.cpp (.../TOverlappedWriterTests.cpp) (revision 301444777085263aae7aff911dd56722f302597e) @@ -2,7 +2,7 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" #include "../TOverlappedWriter.h" -#include "../GTestMacros.h" +#include "../../common/GTestMacros.h" using namespace chengine; Index: src/libchengine/Tests/TReadBufferQueueWrapperTests.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r301444777085263aae7aff911dd56722f302597e --- src/libchengine/Tests/TReadBufferQueueWrapperTests.cpp (.../TReadBufferQueueWrapperTests.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/Tests/TReadBufferQueueWrapperTests.cpp (.../TReadBufferQueueWrapperTests.cpp) (revision 301444777085263aae7aff911dd56722f302597e) @@ -3,7 +3,7 @@ #include "gmock/gmock.h" #include "../TReadBufferQueueWrapper.h" #include -#include "../GTestMacros.h" +#include "../../common/GTestMacros.h" using namespace chengine; using namespace chcore; Index: src/libchengine/Tests/TWriteBufferQueueWrapperTests.cpp =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r301444777085263aae7aff911dd56722f302597e --- src/libchengine/Tests/TWriteBufferQueueWrapperTests.cpp (.../TWriteBufferQueueWrapperTests.cpp) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/Tests/TWriteBufferQueueWrapperTests.cpp (.../TWriteBufferQueueWrapperTests.cpp) (revision 301444777085263aae7aff911dd56722f302597e) @@ -3,7 +3,7 @@ #include "gmock/gmock.h" #include "../TWriteBufferQueueWrapper.h" #include -#include "../GTestMacros.h" +#include "../../common/GTestMacros.h" using namespace chengine; using namespace chcore; Index: src/libchengine/Tests/TestsTThreadedQueueRunner.cpp =================================================================== diff -u --- src/libchengine/Tests/TestsTThreadedQueueRunner.cpp (revision 0) +++ src/libchengine/Tests/TestsTThreadedQueueRunner.cpp (revision 301444777085263aae7aff911dd56722f302597e) @@ -0,0 +1,60 @@ +#include "stdafx.h" +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include "../TThreadedQueueRunner.h" +#include "../TEvent.h" + +using namespace chengine; + +static void TestFunction(int& val) +{ + ++val; +} + +static void TestFunctionWithSleep(int& val) +{ + ++val; + Sleep(50); +} + +TEST(TestsTThreadedQueueRunner, PushSingleTask) +{ + TThreadedQueueRunner> runner; + + int iValue = 0; + runner.PushTask(std::function(std::bind(&TestFunction, std::ref(iValue)))); + runner.Stop(); + + EXPECT_EQ(1, iValue); +} + +TEST(TestsTThreadedQueueRunner, PushMultipleTasks) +{ + TThreadedQueueRunner> runner; + + int iValue = 0; + runner.PushTask(std::function(std::bind(&TestFunctionWithSleep, std::ref(iValue)))); + runner.PushTask(std::function(std::bind(&TestFunctionWithSleep, std::ref(iValue)))); + runner.PushTask(std::function(std::bind(&TestFunctionWithSleep, std::ref(iValue)))); + runner.PushTask(std::function(std::bind(&TestFunctionWithSleep, std::ref(iValue)))); + runner.PushTask(std::function(std::bind(&TestFunctionWithSleep, std::ref(iValue)))); + runner.Stop(); + + EXPECT_EQ(5, iValue); +} + +TEST(TestsTThreadedQueueRunner, PushMultipleTasksWithPreemptiveStart) +{ + TThreadedQueueRunner> runner; + runner.Start(); + + int iValue = 0; + runner.PushTask(std::function(std::bind(&TestFunctionWithSleep, std::ref(iValue)))); + runner.PushTask(std::function(std::bind(&TestFunctionWithSleep, std::ref(iValue)))); + runner.PushTask(std::function(std::bind(&TestFunctionWithSleep, std::ref(iValue)))); + runner.PushTask(std::function(std::bind(&TestFunctionWithSleep, std::ref(iValue)))); + runner.PushTask(std::function(std::bind(&TestFunctionWithSleep, std::ref(iValue)))); + runner.Stop(); + + EXPECT_EQ(5, iValue); +} Index: src/libchengine/Tests/TestsWaitableQueue.cpp =================================================================== diff -u --- src/libchengine/Tests/TestsWaitableQueue.cpp (revision 0) +++ src/libchengine/Tests/TestsWaitableQueue.cpp (revision 301444777085263aae7aff911dd56722f302597e) @@ -0,0 +1,28 @@ +#include "stdafx.h" +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include "../WaitableQueue.h" +#include "../../common/GTestMacros.h" + +using namespace chengine; + +TEST(TestsWaitableQueue, DefaultConstruction) +{ + WaitableQueue queue; + EXPECT_TRUE(queue.GetWaitHandle() != INVALID_HANDLE_VALUE); + EXPECT_TIMEOUT(queue.GetWaitHandle()); +} + +TEST(TestsWaitableQueue, PopFrom_EmptyContainer) +{ + WaitableQueue queue; + EXPECT_THROW(queue.PopFront(), std::exception); +} + +TEST(TestsWaitableQueue, Push) +{ + WaitableQueue queue; + queue.PushBack(5); + EXPECT_SIGNALED(queue.GetWaitHandle()); + EXPECT_EQ(5, queue.PopFront()); +} Index: src/libchengine/WaitableQueue.h =================================================================== diff -u -r0d5b67ee96b435d63f7bf075dc8e28603793b187 -r301444777085263aae7aff911dd56722f302597e --- src/libchengine/WaitableQueue.h (.../WaitableQueue.h) (revision 0d5b67ee96b435d63f7bf075dc8e28603793b187) +++ src/libchengine/WaitableQueue.h (.../WaitableQueue.h) (revision 301444777085263aae7aff911dd56722f302597e) @@ -23,6 +23,8 @@ #include #include #include "TEvent.h" +#include "..\libchcore\ErrorCodes.h" +#include "..\libchcore\TCoreException.h" namespace chengine { @@ -46,6 +48,9 @@ { std::lock_guard lock(m_lock); + if (m_queue.empty()) + throw chcore::TCoreException(chcore::eErr_BoundsExceeded, L"Tried to pop from empty container", LOCATION); + T value = std::move(m_queue.front()); m_queue.pop_front(); Index: src/libchengine/libchengine.vcxproj =================================================================== diff -u -r85b07e753393f661f7d8f528e4238ebb6e9e1204 -r301444777085263aae7aff911dd56722f302597e --- src/libchengine/libchengine.vcxproj (.../libchengine.vcxproj) (revision 85b07e753393f661f7d8f528e4238ebb6e9e1204) +++ src/libchengine/libchengine.vcxproj (.../libchengine.vcxproj) (revision 301444777085263aae7aff911dd56722f302597e) @@ -471,6 +471,7 @@ + @@ -480,7 +481,6 @@ - @@ -506,13 +506,13 @@ + - @@ -521,16 +521,11 @@ - - - - - @@ -643,6 +638,18 @@ true true + + true + true + true + true + + + true + true + true + true + true true @@ -711,15 +718,10 @@ - - - - - Index: src/libchengine/libchengine.vcxproj.filters =================================================================== diff -u -r85b07e753393f661f7d8f528e4238ebb6e9e1204 -r301444777085263aae7aff911dd56722f302597e --- src/libchengine/libchengine.vcxproj.filters (.../libchengine.vcxproj.filters) (revision 85b07e753393f661f7d8f528e4238ebb6e9e1204) +++ src/libchengine/libchengine.vcxproj.filters (.../libchengine.vcxproj.filters) (revision 301444777085263aae7aff911dd56722f302597e) @@ -27,9 +27,6 @@ {1fddd996-c723-4b09-9c98-868df98fe204} - - {e6da867d-b0bd-42d5-a0c8-43542984582f} - {e4894f9f-1e1d-451a-9a02-60b9d682b60f} @@ -194,18 +191,6 @@ Source Files\Task Manager - - Source Files\Tools\SQLite - - - Source Files\Tools\SQLite - - - Source Files\Tools\SQLite - - - Source Files\Tools\SQLite - Source Files\Tools @@ -227,12 +212,6 @@ Source Files\Task - - Source Files\Tools - - - Source Files\Tools - Source Files\Feedback @@ -311,9 +290,6 @@ Source Files\Library files - - Tests - Source Files\Filesystems\OverlappedIO\ReaderWriter @@ -399,6 +375,12 @@ Source Files\Tools + + Tests + + + Source Files\Tools + @@ -485,18 +467,6 @@ Source Files\Task Manager - - Source Files\Tools\SQLite - - - Source Files\Tools\SQLite - - - Source Files\Tools\SQLite - - - Source Files\Tools\SQLite - Source Files\Tools @@ -524,15 +494,9 @@ Tests - - Source Files\Tools - Tests - - Source Files\Tools - Source Files\Feedback @@ -686,6 +650,15 @@ Source Files\Tools + + Tests + + + Tests + + + Source Files\Tools + Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libserializer/TObsoleteFiles.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 301444777085263aae7aff911dd56722f302597e refers to a dead (removed) revision in file `src/libserializer/TObsoleteFiles.h'. Fisheye: No comparison available. Pass `N' to diff? Index: src/libserializer/libserializer.vcxproj =================================================================== diff -u -r898846e0eb46d5f8e3ccb8555d80458ee0e27751 -r301444777085263aae7aff911dd56722f302597e --- src/libserializer/libserializer.vcxproj (.../libserializer.vcxproj) (revision 898846e0eb46d5f8e3ccb8555d80458ee0e27751) +++ src/libserializer/libserializer.vcxproj (.../libserializer.vcxproj) (revision 301444777085263aae7aff911dd56722f302597e) @@ -482,7 +482,6 @@ - @@ -556,7 +555,6 @@ true - Index: src/libserializer/libserializer.vcxproj.filters =================================================================== diff -u -r898846e0eb46d5f8e3ccb8555d80458ee0e27751 -r301444777085263aae7aff911dd56722f302597e --- src/libserializer/libserializer.vcxproj.filters (.../libserializer.vcxproj.filters) (revision 898846e0eb46d5f8e3ccb8555d80458ee0e27751) +++ src/libserializer/libserializer.vcxproj.filters (.../libserializer.vcxproj.filters) (revision 301444777085263aae7aff911dd56722f302597e) @@ -110,16 +110,12 @@ Source Files\Tools - - Source Files\Tools - Source Files\Serialization\Fake Source Files\Tools - Source Files\Tools @@ -129,6 +125,9 @@ Source Files\Tools\ModificationTrackers + + Resource Files + @@ -215,9 +214,6 @@ Source Files\Tools - - Source Files\Tools - Source Files\Serialization\Fake