working on images, adding unit tests for image and buffers

This commit is contained in:
2024-12-08 03:16:10 +01:00
parent f020d8bf2c
commit 52850323fd
21 changed files with 697 additions and 25 deletions

View File

@@ -1,9 +1,11 @@
#include "Common.h"
#include <unity/unity.h>
bool errors_enabled = true;
void DebugCallBack(PulseDebugMessageSeverity severity, const char* message)
{
if(severity == PULSE_DEBUG_MESSAGE_SEVERITY_ERROR)
if(errors_enabled && severity == PULSE_DEBUG_MESSAGE_SEVERITY_ERROR)
TEST_FAIL_MESSAGE(message);
}
@@ -22,6 +24,17 @@ void SetupPulse(PulseBackend* backend)
PulseSetDebugCallback(*backend, DebugCallBack);
}
void SetupDevice(PulseBackend backend, PulseDevice* device)
{
*device = PulseCreateDevice(backend, NULL, 0);
TEST_ASSERT_NOT_EQUAL_MESSAGE(device, PULSE_NULL_HANDLE, PulseVerbaliseErrorType(PulseGetLastErrorType()));
}
void CleanupDevice(PulseDevice device)
{
PulseDestroyDevice(device);
}
void CleanupPulse(PulseBackend backend)
{
PulseUnloadBackend(backend);