Path: blob/main/unittest/src/utils/foxtools/MFXWorkerThreadTest.cpp
169684 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file MFXWorkerThreadTest.cpp14/// @author Michael Behrisch15/// @date Oct 201016///17// Tests the class MFXWorkerThread18/****************************************************************************/192021// ===========================================================================22// included modules23// ===========================================================================24#include <config.h>2526#include <gtest/gtest.h>27#include <utils/common/StdDefs.h>28#include <utils/foxtools/MFXWorkerThread.h>2930class TestTask : public MFXWorkerThread::Task {31public:32void run(MFXWorkerThread* /* context */) {33}34};3536// ===========================================================================37// test definitions38// ===========================================================================39/* Test the initialization.*/40TEST(MFXWorkerThread, test_init) {41MFXWorkerThread::Pool g(4);42}4344/* Test retrieving all tasks.*/45TEST(MFXWorkerThread, test_get_all) {46MFXWorkerThread::Pool g(4);47MFXWorkerThread::Task* task1 = new TestTask();48MFXWorkerThread::Task* task2 = new TestTask();49MFXWorkerThread::Task* task3 = new TestTask();50MFXWorkerThread::Task* task4 = new TestTask();51g.add(task1);52g.add(task2);53g.add(task3);54g.add(task4);55g.waitAll();56}575859