Ticket #4522: 4522.diff

File 4522.diff, 1.3 KB (added by Sandarac, 7 years ago)
  • source/simulation2/tests/test_CmpTemplateManager.h

     
    1717
    1818#include "lib/self_test.h"
    1919
     20#include <boost/algorithm/string.hpp>
     21
    2022#include "simulation2/system/ComponentManager.h"
    2123
    2224#include "simulation2/components/ICmpTemplateManager.h"
     
    223225    {
    224226        g_VFS = CreateVfs(20 * MiB);
    225227        TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/"mods"/"public", VFS_MOUNT_MUST_EXIST));
     228        TS_ASSERT_OK(g_VFS->Mount(L"", DataDir()/"mods"/"mod", VFS_MOUNT_MUST_EXIST));
    226229        TS_ASSERT_OK(g_VFS->Mount(L"cache", DataDir()/"_testcache"));
    227230        CXeromyces::Startup();
    228231    }
     
    245248        CmpPtr<ICmpTemplateManager> cmpTemplateManager(sim, SYSTEM_ENTITY);
    246249        TS_ASSERT(cmpTemplateManager);
    247250
    248         std::vector<std::string> templates = cmpTemplateManager->FindAllTemplates(true);
    249         for (size_t i = 0; i < templates.size(); ++i)
     251        for (const std::string& name : cmpTemplateManager->FindAllTemplates(true))
    250252        {
    251             std::string name = templates[i];
     253            if (boost::algorithm::starts_with(name, L"special_filter/"))
     254                continue;
     255
    252256            printf("# %s\n", name.c_str());
    253257            const CParamNode* p = cmpTemplateManager->GetTemplate(name);
    254258            TS_ASSERT(p != NULL);