<commit_before>#include "gtest/gtest.h"

#include "RdImageManager.hpp"


using namespace rd;


/**
 * @brief Dummy image manager used for testing
 *
 * The required pure virtual members are left with their function body empty.
 *
 * This is the minimum implementation possible for the RdImageManager interface.
 *
 *  @todo Move this class to RdImageLib, set it to be compiled only with the tests
 */
class BasicImageManager : public RdImageManager
{
    public:
        virtual bool start() {}
        virtual bool stop() {}
        virtual RdImage getImage()
        {
            return RdImage();
        }

        //-- This function is needed to register this Manager on the RdImageManager registry
        //-- It ensures that only one manager of this type is created (unique instance)
        static bool RegisterManager()
        {
            if (uniqueInstance == NULL)
            {
                uniqueInstance = new BasicImageManager();
            }

            return Register( uniqueInstance, id);
        }

        //-- The local static reference must be reseted after destroying this manager
        ~BasicImageManager()
        {
            RD_INFO("Hey, I'm a destructor!\n");
            uniqueInstance = NULL;
        }

        //-- This string identifies this manager
        static const std::string id;

    private:
        //-- Store a reference to this manager (unique instance)
        static BasicImageManager * uniqueInstance;
};


BasicImageManager * BasicImageManager::uniqueInstance = NULL;
const std::string BasicImageManager::id = "TEST_MANAGER";


class RdImageManagerTest : public testing::Test
{
    public:
        virtual void SetUp() {<commit_msg>clang complains about illegal instruction; take printf out of destructor as it shouldn't be safe anyway<commit_after>#include "gtest/gtest.h"

#include "RdImageManager.hpp"


using namespace rd;


/**
 * @brief Dummy image manager used for testing
 *
 * The required pure virtual members are left with their function body empty.
 *
 * This is the minimum implementation possible for the RdImageManager interface.
 *
 *  @todo Move this class to RdImageLib, set it to be compiled only with the tests
 */
class BasicImageManager : public RdImageManager
{
    public:
        virtual bool start() {}
        virtual bool stop() {}
        virtual RdImage getImage()
        {
            return RdImage();
        }

        //-- This function is needed to register this Manager on the RdImageManager registry
        //-- It ensures that only one manager of this type is created (unique instance)
        static bool RegisterManager()
        {
            if (uniqueInstance == NULL)
            {
                uniqueInstance = new BasicImageManager();
            }

            return Register( uniqueInstance, id);
        }

        //-- The local static reference must be reseted after destroying this manager
        ~BasicImageManager()
        {
            //RD_INFO("Hey, I'm a destructor!\n");
            uniqueInstance = NULL;
        }

        //-- This string identifies this manager
        static const std::string id;

    private:
        //-- Store a reference to this manager (unique instance)
        static BasicImageManager * uniqueInstance;
};


BasicImageManager * BasicImageManager::uniqueInstance = NULL;
const std::string BasicImageManager::id = "TEST_MANAGER";


class RdImageManagerTest : public testing::Test
{
    public:
        virtual void SetUp() {
{'fraction_non_alphanumeric': 0.07864523536165327, 'fraction_numerical': 0.0, 'mean_word_length': 2.357418111753372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '940868', 'n_tokens_mistral': 876, 'n_tokens_neox': 832, 'n_words': 333}