Enable use of obs-module-helper.hpp in tests

This commit is contained in:
WarmUpTill
2023-12-09 20:06:56 +01:00
committed by WarmUpTill
parent 7914f75876
commit 8c0be8011d
3 changed files with 25 additions and 2 deletions

View File

@@ -1,6 +1,9 @@
#include "obs-module-helper.hpp"
#ifndef UNIT_TEST
#include "switcher-data.hpp"
#endif
#ifndef UNIT_TEST
const char *obs_module_text(const char *text)
{
if (!advss::switcher) {
@@ -16,3 +19,15 @@ obs_module_t *obs_current_module()
}
return advss::switcher->GetModule();
}
#else
const char *obs_module_text(const char *text)
{
return text;
};
obs_module_t *obs_current_module()
{
return nullptr;
}
#endif

View File

@@ -1,5 +1,9 @@
#pragma once
#ifndef UNIT_TEST
#include <obs-module.h>
#else
typedef struct obs_module obs_module_t;
#endif
const char *obs_module_text(const char *text);
obs_module_t *obs_current_module();