<commit_before>#include "./platform/UnitTestSupport.hpp"

#include <PluginFactory/PluginFactory.hpp>
#include <PluginFactory/Exceptions.hpp>

#include <vector>

namespace {

    class PluginInterface
    {
    public:
        virtual ~PluginInterface(){}
        virtual void foo() = 0;
    };

    struct PluginFactoryFixture
    {
        using PluginFactory = PluginFactory::PluginFactory<PluginInterface>;
        
        PluginFactoryFixture()
            : factory("./")
        {
        }
        
        PluginFactory factory;
    };
    
    TEST_FIXTURE(PluginFactoryFixture, verifyPluginFactoryInstantiation)
    {
    }
    
    TEST(verifyPluginFactoryInstantiationThrowsOnPathDoesntExist)
    {
        CHECK_THROW(PluginFactory::PluginFactory<PluginInterface> factory("/ThisPath/Doesnt/Exist"), PluginFactory::PluginPathDoesntExist);
    }
    
    TEST(verifyPluginFactoryInstantiationThrowsOnAPathWhichIsntDirectory)
    {
        CHECK_THROW(PluginFactory::PluginFactory<PluginInterface> factory("./cmake_install.cmake"), PluginFactory::PluginPathIsntDirectory);
    }
    
    TEST_FIXTURE(PluginFactoryFixture, verifyLoad)
    {
        auto plugins = factory.availablePlugins();
        CHECK_EQUAL(0U, plugins.size());
    }
    
    /////////////////////////////////////////////////////
    //
    // The tests below here don't proove anything, merely
    // ensure the class template methods are instantiated.
    //
    
    
    TEST_FIXTURE(PluginFactoryFixture, callLoadWithPath)
    {
        factory.load("path/to/plugin");
    }
    
    TEST_FIXTURE(PluginFactoryFixture, callUnloadWithPath)
    {
        factory.unload("path/to/plugin");
    }
    
    TEST_FIXTURE(PluginFactoryFixture, callCreatePlugin)
    {
        auto plugin = factory.instance("something");
    }
    
    TEST_FIXTURE(PluginFactoryFixture, callCreatePluginWithCreateShared)
    {
        auto plugin = factory.instance("something", PluginFactory::create_shared);
    }
}<commit_msg>ut: ensuring namespace is included on static variable.<commit_after>#include "./platform/UnitTestSupport.hpp"

#include <PluginFactory/PluginFactory.hpp>
#include <PluginFactory/Exceptions.hpp>

#include <vector>

namespace {

    class PluginInterface
    {
    public:
        virtual ~PluginInterface(){}
        virtual void foo() = 0;
    };

    struct PluginFactoryFixture
    {
        using PluginFactory = PluginFactory::PluginFactory<PluginInterface>;
        
        PluginFactoryFixture()
            : factory("./")
        {
        }
        
        PluginFactory factory;
    };
    
    TEST_FIXTURE(PluginFactoryFixture, verifyPluginFactoryInstantiation)
    {
    }
    
    TEST(verifyPluginFactoryInstantiationThrowsOnPathDoesntExist)
    {
        CHECK_THROW(PluginFactory::PluginFactory<PluginInterface> factory("/ThisPath/Doesnt/Exist"), PluginFactory::PluginPathDoesntExist);
    }
    
    TEST(verifyPluginFactoryInstantiationThrowsOnAPathWhichIsntDirectory)
    {
        CHECK_THROW(PluginFactory::PluginFactory<PluginInterface> factory("./cmake_install.cmake"), PluginFactory::PluginPathIsntDirectory);
    }
    
    TEST_FIXTURE(PluginFactoryFixture, verifyLoad)
    {
        auto plugins = factory.availablePlugins();
        CHECK_EQUAL(0U, plugins.size());
    }
    
    /////////////////////////////////////////////////////
    //
    // The tests below here don't proove anything, merely
    // ensure the class template methods are instantiated.
    //
    
    
    TEST_FIXTURE(PluginFactoryFixture, callLoadWithPath)
    {
        factory.load("path/to/plugin");
    }
    
    TEST_FIXTURE(PluginFactoryFixture, callUnloadWithPath)
    {
        factory.unload("path/to/plugin");
    }
    
    TEST_FIXTURE(PluginFactoryFixture, callCreatePlugin)
    {
        auto plugin = factory.instance("something");
    }
    
    TEST_FIXTURE(PluginFactoryFixture, callCreatePluginWithCreateShared)
    {
        auto plugin = factory.instance("something", PluginFactory::PluginFactory::create_shared);
    }
}
{'fraction_non_alphanumeric': 0.11968348170128586, 'fraction_numerical': 0.0009891196834817012, 'mean_word_length': 2.6672710788757934, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '4326539', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1110, 'n_words': 159}