Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions Bdd/Targets/Common/BddTargetFreeRtosPipeline.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ static void GetAppName(struct SolidSyslogHeaderField* field, void* context);
static void GetTimeQuality(struct SolidSyslogTimeQuality* timeQuality);
static void ErrorHandlerEx(void* context, const struct SolidSyslogErrorEvent* event);

/* ---- console glue ---------------------------------------------------------- */

static uint32_t MmioRead32(uintptr_t address)
{
// NOLINTNEXTLINE(performance-no-int-to-ptr) -- mapping the CMSDK UART MMIO address into a 32-bit volatile pointer.
Expand Down Expand Up @@ -219,8 +217,6 @@ void BddTargetFreeRtosPipeline_SetConfig(const struct BddTargetFreeRtosPipelineC
g_config = config;
}

/* ---- SolidSyslog config callbacks ------------------------------------------ */

static void GetAppName(struct SolidSyslogHeaderField* field, void* context)
{
(void) context;
Expand Down Expand Up @@ -269,8 +265,6 @@ static void ErrorHandlerEx(void* context, const struct SolidSyslogErrorEvent* ev
);
}

/* ---- interactive `set` handler --------------------------------------------- */

static bool OnSet(const char* name, const char* value)
{
if (strcmp(name, "appname") == 0)
Expand Down Expand Up @@ -484,8 +478,6 @@ static bool TryParseUInt(const char* value, unsigned long* out)
return true;
}

/* ---- store + security policy lifecycle ------------------------------------- */

/* DEMO KEY ONLY. A real integrator supplies key material from a secure element,
* a KDF, or encrypted NVM via their own SolidSyslogKeyFunction — never a
* hard-coded constant. This exists so the BDD scenario can exercise the mbedTLS
Expand Down Expand Up @@ -661,8 +653,6 @@ static void OnThresholdCrossed(void* context)
(void) printf("[THRESHOLD-CROSSED]\r\n");
}

/* ---- teardown -------------------------------------------------------------- */

/* Full teardown of every shared resource. Two entry points — `quit` (falls
* through after BddTargetInteractive_Run returns) and `set shutdown 1` — both
* route through here. The platform UnmountStore hook fires regardless so the
Expand Down Expand Up @@ -725,8 +715,6 @@ void BddTargetFreeRtosPipeline_Exit(int status)
}
}

/* ---- tasks ----------------------------------------------------------------- */

void BddTargetFreeRtosPipeline_InteractiveTask(void* argument)
{
(void) argument;
Expand Down
1 change: 0 additions & 1 deletion Bdd/features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ def _dump_target_log(process, attr, channel, prefix):


def after_scenario(context, scenario):
# Clean up any long-lived interactive process
if hasattr(context, "interactive_process"):
process = context.interactive_process
if process.poll() is None:
Expand Down
2 changes: 0 additions & 2 deletions Bdd/features/steps/syslog_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,6 @@ def step_check_msg(context, msg):
@then("the syslog oracle receives {count:d} message")
@then("the syslog oracle receives {count:d} messages")
def step_check_message_count(context, count):
# For interactive processes, refresh the line count
if hasattr(context, "interactive_process"):
wait_for_messages(context, count)
assert context.message_count == count, (
Expand Down Expand Up @@ -1277,7 +1276,6 @@ def step_check_contiguous_sequence_ids(context):
f"No sequenceId in structured data: {sd}"
)
ids.append(int(match.group(1)))
# Check that IDs form a contiguous ascending sequence
for i in range(1, len(ids)):
assert ids[i] == ids[i - 1] + 1, (
f"Non-contiguous sequenceIds: {ids[i - 1]} followed by {ids[i]}"
Expand Down
16 changes: 0 additions & 16 deletions Core/Source/SolidSyslogBlockStore.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ static void BlockStore_ResumeFromExistingBlock(struct SolidSyslogBlockStore* sel
}
}

/* ------------------------------------------------------------------
* BlockStore_Write
* ----------------------------------------------------------------*/

static bool BlockStore_StoreRecord(struct SolidSyslogBlockStore* self, const void* data, size_t size);

static bool BlockStore_Write(struct SolidSyslogStore* base, const void* data, size_t size)
Expand Down Expand Up @@ -145,10 +141,6 @@ static bool BlockStore_StoreRecord(struct SolidSyslogBlockStore* self, const voi
return written;
}

/* ------------------------------------------------------------------
* BlockStore_HasUnsent / BlockStore_IsHalted / BlockStore_GetTotalBytes / BlockStore_GetUsedBytes
* ----------------------------------------------------------------*/

static bool BlockStore_HasUnsent(struct SolidSyslogStore* base)
{
return BlockSequence_HasUnsent(BlockStore_SelfFromBase(base)->BlockSequence);
Expand Down Expand Up @@ -178,10 +170,6 @@ static bool BlockStore_IsTransient(struct SolidSyslogStore* base)
return false;
}

/* ------------------------------------------------------------------
* BlockStore_ReadNextUnsent
* ----------------------------------------------------------------*/

static bool BlockStore_ReadCurrent(struct SolidSyslogBlockStore* self, void* data, size_t maxSize, size_t* bytesRead);

static bool BlockStore_ReadNextUnsent(struct SolidSyslogStore* base, void* data, size_t maxSize, size_t* bytesRead)
Expand Down Expand Up @@ -218,10 +206,6 @@ static bool BlockStore_ReadCurrent(struct SolidSyslogBlockStore* self, void* dat
);
}

/* ------------------------------------------------------------------
* BlockStore_MarkSent
* ----------------------------------------------------------------*/

static void BlockStore_MarkSent(struct SolidSyslogStore* base)
{
struct SolidSyslogBlockStore* self = BlockStore_SelfFromBase(base);
Expand Down
2 changes: 0 additions & 2 deletions Core/Source/SolidSyslogCircularBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ static inline void CircularBuffer_ConsumeWrapMarker(struct SolidSyslogCircularBu

static inline size_t CircularBuffer_PeekRecordSize(const struct SolidSyslogCircularBuffer* self)
{
/* Little-endian read of the 2-byte length header out of the uint8_t ring. */
return ((size_t) self->Ring[self->Head]) | (((size_t) self->Ring[self->Head + 1U]) << 8U);
}

Expand Down Expand Up @@ -185,7 +184,6 @@ static inline void CircularBuffer_WrapTail(struct SolidSyslogCircularBuffer* sel

static inline void CircularBuffer_StoreRecord(struct SolidSyslogCircularBuffer* self, const void* data, size_t size)
{
/* Little-endian write of the 2-byte length header into the uint8_t ring. */
self->Ring[self->Tail] = (uint8_t) (size & 0xFFU);
self->Ring[self->Tail + 1U] = (uint8_t) ((size >> 8U) & 0xFFU);
(void) memcpy(&self->Ring[self->Tail + HEADER_BYTES], data, size);
Expand Down
16 changes: 0 additions & 16 deletions Core/Source/SolidSyslogFileBlockDevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ static inline void FileBlockDevice_CloseIfOpen(struct OpenHandle* handle)
}
}

/* ------------------------------------------------------------------
* FileBlockDevice_Acquire
* ----------------------------------------------------------------*/

static bool FileBlockDevice_EnsureHandleOpenOnBlock(
struct OpenHandle* handle,
const struct SolidSyslogFileBlockDevice* self,
Expand Down Expand Up @@ -220,10 +216,6 @@ static inline const char* FileBlockDevice_FormatBlockFilename(
return SolidSyslogFormatter_AsFormattedBuffer(formatter);
}

/* ------------------------------------------------------------------
* FileBlockDevice_Dispose
* ----------------------------------------------------------------*/

static inline void FileBlockDevice_CloseIfHoldingBlock(struct OpenHandle* handle, size_t blockIndex);

static bool FileBlockDevice_Dispose(struct SolidSyslogBlockDevice* base, size_t blockIndex)
Expand Down Expand Up @@ -253,10 +245,6 @@ static inline void FileBlockDevice_CloseIfHoldingBlock(struct OpenHandle* handle
}
}

/* ------------------------------------------------------------------
* FileBlockDevice_Exists
* ----------------------------------------------------------------*/

static bool FileBlockDevice_Exists(struct SolidSyslogBlockDevice* base, size_t blockIndex)
{
bool exists = false;
Expand All @@ -272,10 +260,6 @@ static bool FileBlockDevice_Exists(struct SolidSyslogBlockDevice* base, size_t b
return exists;
}

/* ------------------------------------------------------------------
* FileBlockDevice_Read / FileBlockDevice_Append / FileBlockDevice_WriteAt / FileBlockDevice_Size
* ----------------------------------------------------------------*/

// NOLINTBEGIN(bugprone-easily-swappable-parameters) -- vtable signature: blockIndex / offset are positional, distinct semantics
static bool FileBlockDevice_Read(
struct SolidSyslogBlockDevice* base,
Expand Down
36 changes: 0 additions & 36 deletions Tests/FileFake.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ static const struct SolidSyslogFile POISONED_VTABLE = {
FileFake_DestroyedDelete,
};

/* ------------------------------------------------------------------
* Create / Destroy
* ----------------------------------------------------------------*/

struct SolidSyslogFile* FileFake_Create(struct FileFakeStorage* storage)
{
struct FileFake* fake = (struct FileFake*) storage;
Expand All @@ -164,10 +160,6 @@ void FileFake_Destroy(void)
memset(filesystem, 0, sizeof(filesystem));
}

/* ------------------------------------------------------------------
* Fail injection
* ----------------------------------------------------------------*/

void FileFake_FailNextOpen(struct SolidSyslogFile* file)
{
if (file == NULL)
Expand Down Expand Up @@ -208,10 +200,6 @@ void FileFake_FailNextDelete(struct SolidSyslogFile* file)
AsFake(file)->failNextDelete = true;
}

/* ------------------------------------------------------------------
* Inspection
* ----------------------------------------------------------------*/

const void* FileFake_FileContent(void)
{
return HasActiveFile(lastCreated) ? lastCreated->active->content : NULL;
Expand All @@ -227,10 +215,6 @@ static inline bool HasActiveFile(const struct FileFake* fake)
return FoundEntry(fake->active);
}

/* ------------------------------------------------------------------
* Open
* ----------------------------------------------------------------*/

static bool FileFake_Open(struct SolidSyslogFile* self, const char* path)
{
struct FileFake* fake = AsFake(self);
Expand Down Expand Up @@ -351,10 +335,6 @@ static inline void InitialiseEntry(struct FileEntry* entry, const char* path)
SafeString_Copy(entry->path, FILEFAKE_MAX_PATH, path);
}

/* ------------------------------------------------------------------
* Close
* ----------------------------------------------------------------*/

static void FileFake_Close(struct SolidSyslogFile* self)
{
struct FileFake* fake = AsFake(self);
Expand All @@ -380,20 +360,12 @@ static inline bool IsFileClosed(const struct FileFake* fake)
return !fake->open;
}

/* ------------------------------------------------------------------
* IsOpen
* ----------------------------------------------------------------*/

static bool FileFake_IsOpen(struct SolidSyslogFile* self)
{
struct FileFake* fake = AsFake(self);
return fake->open;
}

/* ------------------------------------------------------------------
* Read
* ----------------------------------------------------------------*/

static bool FileFake_Read(struct SolidSyslogFile* self, void* buf, size_t count)
{
struct FileFake* fake = AsFake(self);
Expand Down Expand Up @@ -430,10 +402,6 @@ static inline void AdvancePosition(struct FileFake* fake, size_t count)
fake->position += count;
}

/* ------------------------------------------------------------------
* Write
* ----------------------------------------------------------------*/

static bool FileFake_Write(struct SolidSyslogFile* self, const void* buf, size_t count)
{
struct FileFake* fake = AsFake(self);
Expand Down Expand Up @@ -474,10 +442,6 @@ static inline void ExtendFileSize(struct FileFake* fake)
}
}

/* ------------------------------------------------------------------
* SeekTo / Size / Truncate / Exists
* ----------------------------------------------------------------*/

static void FileFake_SeekTo(struct SolidSyslogFile* self, size_t offset)
{
struct FileFake* fake = AsFake(self);
Expand Down
18 changes: 0 additions & 18 deletions Tests/FileFakeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,6 @@ TEST(FileFake, DeleteReturnsFalseForUnknownFile)
CHECK_FALSE(SolidSyslogFile_Delete(api, "nonexistent.dat"));
}

/* ------------------------------------------------------------------
* Two independent instances
* ----------------------------------------------------------------*/

TEST(FileFake, TwoInstancesShareFilesystem)
{
SolidSyslogFile_Open(api, "shared.dat");
Expand Down Expand Up @@ -302,10 +298,6 @@ TEST(FileFake, OpenWhileAnotherInstanceHoldsPathOpenAsserts)
api = FileFake_Create(&storage);
}

/* ------------------------------------------------------------------
* Operations on closed file
* ----------------------------------------------------------------*/

TEST(FileFake, CloseWithNoFileOpenThrows)
{
CHECK_THROWS(std::runtime_error, SolidSyslogFile_Close(api));
Expand Down Expand Up @@ -337,10 +329,6 @@ TEST(FileFake, TruncateWithNoFileOpenThrows)
CHECK_THROWS(std::runtime_error, SolidSyslogFile_Truncate(api));
}

/* ------------------------------------------------------------------
* Operations after Destroy
* ----------------------------------------------------------------*/

// clang-format off
TEST_GROUP(FileFakeAfterDestroy)
{
Expand Down Expand Up @@ -411,10 +399,6 @@ TEST(FileFakeAfterDestroy, DeleteThrows)
CHECK_THROWS(std::runtime_error, SolidSyslogFile_Delete(api, "test.dat"));
}

/* ------------------------------------------------------------------
* Stale handle after delete
* ----------------------------------------------------------------*/

// clang-format off
TEST_GROUP(FileFakeStaleHandle)
{
Expand All @@ -439,12 +423,10 @@ TEST_GROUP(FileFakeStaleHandle)

TEST(FileFakeStaleHandle, ReadFailsOnStaleHandleAfterDeleteAndSlotReuse)
{
/* handleA opens file "old.dat" and writes data */
SolidSyslogFile_Open(handleA, "old.dat");
const char data[] = "original";
SolidSyslogFile_Write(handleA, data, sizeof(data));

/* Delete the file via handleB */
SolidSyslogFile_Delete(handleB, "old.dat");

/* Create a new file that could reuse the freed slot */
Expand Down
2 changes: 0 additions & 2 deletions Tests/SolidSyslogBlockStorePosixTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,9 @@ TEST(SolidSyslogBlockStorePosix, DiscardOldestWhenReadIsPartwayThroughOldestBloc
std::memset(msgC, 'C', sizeof(msgC));
std::memset(msgD, 'D', sizeof(msgD));

/* Fill block 00 with two records */
SolidSyslogStore_Write(store, msgA, sizeof(msgA));
SolidSyslogStore_Write(store, msgB, sizeof(msgB));

/* Fill block 01 with two records */
SolidSyslogStore_Write(store, msgC, sizeof(msgC));
SolidSyslogStore_Write(store, msgD, sizeof(msgD));

Expand Down
Loading
Loading