/**
 * @file UDPStreamerGTest.cpp
 * @brief Source file for class UDPStreamerGTest
 * @date 13/05/2026
 * @author Martino Ferrari
 *
 * @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
 * the Development of Fusion Energy ('Fusion for Energy').
 * Licensed under the EUPL, Version 1.1 or - as soon they will be approved
 * by the European Commission - subsequent versions of the EUPL (the "Licence")
 * You may not use this work except in compliance with the Licence.
 * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
 *
 * @warning Unless required by applicable law or agreed to in writing,
 * software distributed under the Licence is distributed on an "AS IS"
 * basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the Licence permissions and limitations under the Licence.
 *
 * @details This source file contains the GTest wrapper for all UDPStreamer tests.
 */

#define DLL_API

/*---------------------------------------------------------------------------*/
/*                         Standard header includes                          */
/*---------------------------------------------------------------------------*/
#include "gtest/gtest.h"
#include <limits.h>

/*---------------------------------------------------------------------------*/
/*                         Project header includes                           */
/*---------------------------------------------------------------------------*/
#include "UDPStreamerTest.h"

/*---------------------------------------------------------------------------*/
/*                           Method definitions                              */
/*---------------------------------------------------------------------------*/

TEST(UDPStreamerGTest, TestConstructor) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestConstructor());
}

TEST(UDPStreamerGTest, TestInitialise_Valid) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestInitialise_Valid());
}

TEST(UDPStreamerGTest, TestInitialise_DefaultPort) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestInitialise_DefaultPort());
}

TEST(UDPStreamerGTest, TestInitialise_InvalidMaxPayloadSize) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestInitialise_InvalidMaxPayloadSize());
}

TEST(UDPStreamerGTest, TestInitialise_ZeroStackSize) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestInitialise_ZeroStackSize());
}

TEST(UDPStreamerGTest, TestInitialise_AutoMode_Valid) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestInitialise_AutoMode_Valid());
}

TEST(UDPStreamerGTest, TestInitialise_AutoMode_MissingRefreshRate) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestInitialise_AutoMode_MissingRefreshRate());
}

TEST(UDPStreamerGTest, TestInitialise_UnknownPublishingMode) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestInitialise_UnknownPublishingMode());
}

TEST(UDPStreamerGTest, TestGetBrokerName_Output) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestGetBrokerName_Output());
}

TEST(UDPStreamerGTest, TestGetBrokerName_Input) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestGetBrokerName_Input());
}

TEST(UDPStreamerGTest, TestAllocateMemory) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestAllocateMemory());
}

TEST(UDPStreamerGTest, TestSetConfiguredDatabase_BasicSignals) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestSetConfiguredDatabase_BasicSignals());
}

TEST(UDPStreamerGTest, TestSetConfiguredDatabase_Quantized) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestSetConfiguredDatabase_Quantized());
}

TEST(UDPStreamerGTest, TestSetConfiguredDatabase_InvalidQuantOnInteger) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestSetConfiguredDatabase_InvalidQuantOnInteger());
}

TEST(UDPStreamerGTest, TestSetConfiguredDatabase_UnknownQuantType) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestSetConfiguredDatabase_UnknownQuantType());
}

TEST(UDPStreamerGTest, TestSetConfiguredDatabase_TimeModePacket) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestSetConfiguredDatabase_TimeModePacket());
}

TEST(UDPStreamerGTest, TestSetConfiguredDatabase_TimeModeFullArray) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestSetConfiguredDatabase_TimeModeFullArray());
}

TEST(UDPStreamerGTest, TestSetConfiguredDatabase_TimeModeFirstSample) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestSetConfiguredDatabase_TimeModeFirstSample());
}

TEST(UDPStreamerGTest, TestSetConfiguredDatabase_MissingSamplingRate) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestSetConfiguredDatabase_MissingSamplingRate());
}

TEST(UDPStreamerGTest, TestSetConfiguredDatabase_InvalidTimeSignal) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestSetConfiguredDatabase_InvalidTimeSignal());
}

TEST(UDPStreamerGTest, TestSetConfiguredDatabase_FullArrayMismatch) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestSetConfiguredDatabase_FullArrayMismatch());
}

TEST(UDPStreamerGTest, TestPrepareNextState) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestPrepareNextState());
}

TEST(UDPStreamerGTest, TestSynchronise_NoClient) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestSynchronise_NoClient());
}

TEST(UDPStreamerGTest, TestExecute_ConnectDataDisconnect) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestExecute_ConnectDataDisconnect());
}

TEST(UDPStreamerGTest, TestExecute_Fragmentation) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestExecute_Fragmentation());
}

TEST(UDPStreamerGTest, TestQuantization_Uint16Extremes) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestQuantization_Uint16Extremes());
}

TEST(UDPStreamerGTest, TestQuantization_Uint8Clamping) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestQuantization_Uint8Clamping());
}

TEST(UDPStreamerGTest, TestGetPort) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestGetPort());
}

TEST(UDPStreamerGTest, TestGetMaxPayloadSize) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestGetMaxPayloadSize());
}

TEST(UDPStreamerGTest, TestIsClientConnected_InitiallyFalse) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestIsClientConnected_InitiallyFalse());
}

TEST(UDPStreamerGTest, TestHighFrequency_AllocateMemory) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestHighFrequency_AllocateMemory());
}

TEST(UDPStreamerGTest, TestHighFrequency_Fragmentation) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestHighFrequency_Fragmentation());
}

TEST(UDPStreamerGTest, TestHighFrequency_DataIntegrity) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestHighFrequency_DataIntegrity());
}

TEST(UDPStreamerGTest, TestInitialise_MulticastMode_Valid) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestInitialise_MulticastMode_Valid());
}

TEST(UDPStreamerGTest, TestInitialise_MulticastMode_DefaultDataPort) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestInitialise_MulticastMode_DefaultDataPort());
}

TEST(UDPStreamerGTest, TestInitialise_MulticastMode_InvalidDataPort) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestInitialise_MulticastMode_InvalidDataPort());
}

TEST(UDPStreamerGTest, TestPrepareNextState_Multicast) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestPrepareNextState_Multicast());
}

TEST(UDPStreamerGTest, TestExecute_MulticastConnectDataDisconnect) {
    UDPStreamerTest test;
    ASSERT_TRUE(test.TestExecute_MulticastConnectDataDisconnect());
}
