Skip to content

Commit

Permalink
Remove search path test.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jul 27, 2020
1 parent 6b801d4 commit 3b8f58e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 41 deletions.
7 changes: 0 additions & 7 deletions pdal/PluginDirectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ StringList pluginSearchPaths()

for (std::string s : possiblePaths)
{
std::cerr << "Path/Canonical = " << s << " / ";
s = FileUtils::toCanonicalPath(s);
std::cerr << s << "!\n";
if (s.size() && !Utils::contains(searchPaths, s))
searchPaths.push_back(s);
}
Expand Down Expand Up @@ -141,11 +139,6 @@ PluginDirectory::PluginDirectory()
}
}

StringList PluginDirectory::test_pluginSearchPaths()
{
return pluginSearchPaths();
}

std::string PluginDirectory::test_validPlugin(const std::string& path,
const StringList& types)
{
Expand Down
1 change: 0 additions & 1 deletion pdal/PluginDirectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class PluginDirectory

private:
static PluginDirectory *m_instance;
PDAL_DLL static StringList test_pluginSearchPaths();
PDAL_DLL static std::string test_validPlugin(const std::string& path,
const StringList& types);
};
Expand Down
38 changes: 5 additions & 33 deletions test/unit/PluginManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ struct DummyPlugin : Filter

static PF_ExitFunc initPlugin() // PF_InitFunc
{
PluginInfo pi { "filters.dummytest", "A dummy plugin registered at run-time", "http://somewhere" };
PluginInfo pi {
"filters.dummytest",
"A dummy plugin registered at run-time",
"http://somewhere"
};
pdal::PluginManager<Stage>::registerPlugin<DummyPlugin>(pi);
}

Expand All @@ -81,38 +85,6 @@ TEST(PluginManagerTest, CreateObject)
EXPECT_NE(p.get(), nullptr);
}

TEST(PluginManagerTest, SearchPaths)
{
std::string curPath;
int set = Utils::getenv("PDAL_DRIVER_PATH", curPath);
Utils::unsetenv("PDAL_DRIVER_PATH");

StringList paths = PluginDirectory::test_pluginSearchPaths();
EXPECT_TRUE(Utils::contains(paths, Config::pluginInstallPath()));

#ifdef _WIN32
Utils::setenv("PDAL_DRIVER_PATH", "C:\foo\bar;D:\baz");
#else
Utils::setenv("PDAL_DRIVER_PATH", "/foo/bar://baz");
#endif
paths = PluginDirectory::test_pluginSearchPaths();
EXPECT_EQ(paths.size(), 2U);

#ifdef _WIN32
EXPECT_TRUE(Utils::contains(paths, "C:\foo\bar"));
EXPECT_TRUE(Utils::contains(paths, "D:\baz"));
#else
EXPECT_TRUE(Utils::contains(paths, "/foo/bar"));
EXPECT_TRUE(Utils::contains(paths, "//baz"));
#endif
Utils::setenv("PDAL_DRIVER_PATH", "/this/is/a/path");
paths = PluginDirectory::test_pluginSearchPaths();
EXPECT_EQ(paths.size(), 1U);
EXPECT_TRUE(Utils::contains(paths, "/this/is/a/path"));

if (set == 0)
Utils::setenv("PDAL_DRIVER_PATH", curPath);
}

TEST(PluginManagerTest, validnames)
{
Expand Down

0 comments on commit 3b8f58e

Please sign in to comment.