Skip to content
Merged
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: 11 additions & 1 deletion Svc/BufferLogger/test/ut/Errors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
//
// ======================================================================

#include <cstdlib>
// If this is compiled for unix, include unistd to check user id
#if defined(__linux__) || defined(__unix__) || defined(__APPLE__)
#include <unistd.h>
#endif

#include <cstdlib>
#include "Errors.hpp"
#include "Os/ValidatedFile.hpp"

Expand Down Expand Up @@ -132,6 +136,12 @@ void BufferLoggerTester ::LogFileWrite() {
}

void BufferLoggerTester ::LogFileValidation() {
// Skip test if running as root, since root bypasses Unix permission checks
#if defined(__linux__) || defined(__unix__) || defined(__APPLE__)
if (getuid() == 0) {
GTEST_SKIP() << "Test skipped when running as root (permission checks are bypassed)";
}
#endif
this->component.m_file.m_baseName = Fw::String("LogFileValidation");

// Send data
Expand Down
Loading