diff --git a/Test/UnitTests/UnitTests.cpp b/Test/UnitTests/UnitTests.cpp index a301d8b..3c4e66b 100644 --- a/Test/UnitTests/UnitTests.cpp +++ b/Test/UnitTests/UnitTests.cpp @@ -58,16 +58,16 @@ public: // 3. Broker Active Status volatile bool active = false; - Vec indices; - Vec sizes; + Vector indices; + Vector sizes; FastPollingMutexSem mutex; DebugSignalInfo* ptrs[1] = { service.signals[0] }; volatile bool anyBreak = false; - Vec breakIdx; + Vector breakIdx; service.RegisterBroker(ptrs, 1, NULL_PTR(MemoryMapBroker*), &active, &indices, &sizes, &mutex, &anyBreak, &breakIdx); service.UpdateBrokersActiveStatus(); assert(active == true); - assert(indices.Size() == 1); + assert(indices.GetNumberOfElements() == 1); assert(indices[0] == 0); // Helper Process @@ -244,11 +244,11 @@ public: // Register a broker whose signalPointers is NULL but numSignals > 0. // Before the fix this dereferenced NULL → segfault. volatile bool active = false; - Vec indices; - Vec sizes; + Vector indices; + Vector sizes; FastPollingMutexSem mutex; volatile bool anyBreak = false; - Vec breakIdx; + Vector breakIdx; service.RegisterBroker(NULL_PTR(DebugSignalInfo**), 1u, NULL_PTR(MemoryMapBroker*), &active, &indices, &sizes, &mutex, @@ -538,11 +538,11 @@ public: assert(service.TraceSignal("Z", true) == 1); volatile bool active = false; - Vec indices; - Vec sizes; + Vector indices; + Vector sizes; FastPollingMutexSem mutex; volatile bool anyBreak = false; - Vec breakIdx; + Vector breakIdx; DebugSignalInfo *ptrs[3] = { service.signals[0], service.signals[1], service.signals[2] }; @@ -554,7 +554,7 @@ public: // After Swap the broker's activeIndices must hold exactly indices 0 and 2 assert(active == true); - assert(indices.Size() == 2u); + assert(indices.GetNumberOfElements() == 2u); // indices are in order of signal position in the broker (0 then 2) assert(indices[0] == 0u); assert(indices[1] == 2u); @@ -563,7 +563,7 @@ public: // Disable one; Swap again — only index 0 should remain assert(service.TraceSignal("Z", false) == 1); service.UpdateBrokersActiveStatus(); - assert(indices.Size() == 1u); + assert(indices.GetNumberOfElements() == 1u); assert(indices[0] == 0u); printf(" -> PASS: After disabling Z, only index 0 remains\n"); } @@ -592,11 +592,11 @@ public: service.UpdateBrokersBreakStatus(); volatile bool active = false; - Vec indices; - Vec sizes; + Vector indices; + Vector sizes; FastPollingMutexSem mutex; volatile bool anyBreak = false; - Vec breakIdx; + Vector breakIdx; DebugSignalInfo *ptrs[1] = { service.signals[0] }; service.RegisterBroker(ptrs, 1u, NULL_PTR(MemoryMapBroker *), &active, &indices, &sizes, &mutex, @@ -605,7 +605,7 @@ public: // UpdateBrokersBreakStatus must propagate the break flag to the broker service.UpdateBrokersBreakStatus(); assert(anyBreak == true); - assert(breakIdx.Size() == 1u); + assert(breakIdx.GetNumberOfElements() == 1u); // Process() copies break indices, releases lock, evaluates break. // val = 5 > 3 — service must become paused. diff --git a/compile_commands.json b/compile_commands.json index fec99cf..5766e98 100644 --- a/compile_commands.json +++ b/compile_commands.json @@ -183,5 +183,99 @@ ], "directory": "/home/martino/Projects/marte_debug/Source/Components/Interfaces/WebDebugService", "output": "../../../..//Build/x86-linux/Components/Interfaces/WebDebugService/WebDebugService.o" + }, + { + "file": "../../../..//Source/Components/Interfaces/DebugService/DebugServiceBase.cpp", + "arguments": [ + "/usr/bin/g++", + "-c", + "-I../../../..//Source/Components/Interfaces/TCPLogger", + "-I../../../..//Source/Components/Interfaces/DebugService", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Logger", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs", + "-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability", + "-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services", + "-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L4Messages", + "-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L4LoggerService", + "-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L5GAMs", + "-I/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability", + "-I/home/martino/workspace/MARTe2/Source/Core/FileSystem/L3Streams", + "-fPIC", + "-Wall", + "-std=c++98", + "-Werror", + "-Wno-invalid-offsetof", + "-Wno-unused-variable", + "-fno-strict-aliasing", + "-frtti", + "-DMARTe2_TEST_ENVIRONMENT=GTest", + "-DARCHITECTURE=x86_gcc", + "-DENVIRONMENT=Linux", + "-DUSE_PTHREAD", + "-pthread", + "-Wno-deprecated-declarations", + "-Wno-unused-value", + "-g", + "-ggdb", + "../../../..//Source/Components/Interfaces/DebugService/DebugServiceBase.cpp", + "-o", + "../../../..//Build/x86-linux/Components/Interfaces/WebDebugService/DebugServiceBase.o" + ], + "directory": "/home/martino/Projects/marte_debug/Source/Components/Interfaces/WebDebugService", + "output": "../../../..//Build/x86-linux/Components/Interfaces/WebDebugService/DebugServiceBase.o" + }, + { + "file": "UnitTests.cpp", + "arguments": [ + "/usr/bin/g++", + "-c", + "-I../../Source/Core/Types/Result", + "-I../../Source/Core/Types/Vec", + "-I../../Source/Components/Interfaces/DebugService", + "-I../../Source/Components/Interfaces/TCPLogger", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Messages", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Logger", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration", + "-I/home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs", + "-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L1Portability", + "-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L3Services", + "-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L4Messages", + "-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L4LoggerService", + "-I/home/martino/workspace/MARTe2/Source/Core/Scheduler/L5GAMs", + "-I/home/martino/workspace/MARTe2/Source/Core/FileSystem/L1Portability", + "-I/home/martino/workspace/MARTe2/Source/Core/FileSystem/L3Streams", + "-fPIC", + "-Wall", + "-std=c++98", + "-Werror", + "-Wno-invalid-offsetof", + "-Wno-unused-variable", + "-fno-strict-aliasing", + "-frtti", + "-DMARTe2_TEST_ENVIRONMENT=GTest", + "-DARCHITECTURE=x86_gcc", + "-DENVIRONMENT=Linux", + "-DUSE_PTHREAD", + "-pthread", + "-Wno-deprecated-declarations", + "-Wno-unused-value", + "-g", + "-ggdb", + "UnitTests.cpp", + "-o", + "../../Build/x86-linux/Test/UnitTests/UnitTests/UnitTests.o" + ], + "directory": "/home/martino/Projects/marte_debug/Test/UnitTests", + "output": "../../Build/x86-linux/Test/UnitTests/UnitTests/UnitTests.o" } ] \ No newline at end of file