Extends migration tests for flm and flt services

This commit is contained in:
berrux-dev committed 2026-09-18 17:49:15 +02:00
1 parent ce47b9236f
commit 501bd2b4b8
7 files changed
+232 -54

No files matched your search

@@ -3,9 +3,12 @@
* @brief Tests für BUILD_RTI conditional compilation guards
*
* Tests verify that:
* 1. Code compiles with BUILD_RTI=OFF (fallback mode)
* 2. RTI-dependent code is properly guarded
* 3. Non-RTI code paths work correctly
* 1. BUILD_RTI is defined as 1 in the validated configuration
* 2. RTI-dependent code paths are active (BUILD_RTI=ON)
* 3. #if BUILD_RTI guards compile and evaluate correctly
*
* BUILD_RTI=ON is the only valid migration configuration — the OFF
* variant is neither built nor tested.
*/
#include <gtest/gtest.h>
@@ -23,27 +26,25 @@ TEST(BuildRTIGuards, MacroDefined)
#endif
}
// Test 2: Verify DDS connector compiles without RTI
TEST(BuildRTIGuards, DDSConnectorFallback)
// Test 2: Verify RTI code paths are active in the validated configuration
TEST(BuildRTIGuards, RtiAvailableInValidatedConfig)
{
// This test verifies that DDS-related headers can be included
// and basic functionality works without RTI libraries
// The actual DDS connector should have fallback implementations
// The validated migration configuration is BUILD_RTI=ON: the RTI
// code paths must be compiled in and available.
bool rti_available = false;
#ifdef BUILD_RTI
rti_available = true;
#endif
EXPECT_FALSE(rti_available); // In fallback mode, RTI is not available
EXPECT_TRUE(rti_available);
}
// Test 3: Verify conditional compilation doesn't break build
TEST(BuildRTIGuards, ConditionalCompilationSafe)
{
// Verify that #if BUILD_RTI guards don't cause syntax errors
// Verify that #if BUILD_RTI guards evaluate to the active branch
int value = 0;
#if BUILD_RTI
value = 1;
#endif
// In fallback mode, value should remain 0
EXPECT_EQ(value, 0);
EXPECT_EQ(value, 1);
}