/*! * * Copyright (c) 2020-2025 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file tst_threads.cpp * \author (last) Behrouz NematiPour * \date (last) 22-Feb-2024 * \author (original) Behrouz NematiPour * \date (original) 21-Apr-2020 * */ #include "tst_threads.h" // Qt // Project #include "Threads.h" #include "ApplicationController.h" #include "GuiController.h" #include "DeviceController.h" #include "CanInterface.h" #include "FrameInterface.h" #include "MessageDispatcher.h" #include "MessageAcknowModel.h" tst_threads::tst_threads(QObject *parent) : QObject(parent) { } void tst_threads::initTestCase() { Threads::registerTypes(); } void tst_threads::tst_Thread_init() { QCOMPARE( _Logger .init(Threads::_Logger_Thread ), ! _Logger .init(Threads::_Logger_Thread )); QCOMPARE( _DeviceController .init(Threads::_DeviceController_Thread ), ! _DeviceController .init(Threads::_DeviceController_Thread )); QCOMPARE( _CanInterface .init(Threads::_CanFrame_Thread ), ! _CanInterface .init(Threads::_CanFrame_Thread )); QCOMPARE( _FrameInterface .init(Threads::_CanFrame_Thread ), ! _FrameInterface .init(Threads::_CanFrame_Thread )); QCOMPARE( _MessageAcknowModel .init(Threads::_CanAcknow_Thread ), ! _MessageAcknowModel .init(Threads::_CanAcknow_Thread )); QCOMPARE( _MessageDispatcher .init(Threads::_CanMessage_Thread ), ! _MessageDispatcher .init(Threads::_CanMessage_Thread )); QCOMPARE( _ApplicationController .init(Threads::_Application_Thread ), ! _ApplicationController .init(Threads::_Application_Thread )); QCOMPARE( _GuiController .init(Threads::_Gui_Thread ), ! _GuiController .init(Threads::_Gui_Thread )); } void tst_threads::tst_Thread_names() { QCOMPARE( _Logger .thread()->objectName(), "Storage::Logger_Thread" ); QCOMPARE( _DeviceController .thread()->objectName(), "Device::DeviceController_Thread" ); QCOMPARE( _CanInterface .thread()->objectName(), "Can::FrameInterface_Thread" ); QCOMPARE( _FrameInterface .thread()->objectName(), "Can::FrameInterface_Thread" ); QCOMPARE( _MessageAcknowModel .thread()->objectName(), "Can::MessageAcknowModel_Thread" ); QCOMPARE( _MessageDispatcher .thread()->objectName(), "Can::MessageDispatcher_Thread" ); QCOMPARE( _ApplicationController .thread()->objectName(), "ApplicationController_Thread" ); QCOMPARE( _GuiController .thread()->objectName(), "Gui::GuiController_Thread" ); }