/******************************************************************************** * Copyright (c) 2025-2026 ZF Friedrichshafen AG * * This program and the accompanying materials are made available under the * terms of the Apache License Version 2.0 which is available at * https://www.apache.org/licenses/LICENSE-2.0 * * SPDX-License-Identifier: Apache-2.0 * * Contributors: * Erik Verhoeven - initial API and implementation ********************************************************************************/ #include #include #include #include #include #include "../../../global/exec_dir_helper.h" TEST(CoreLibrary_AppControl, SetModuleSearchPath) { sdv::core::IModuleControlConfig* pModuleConfig = sdv::core::GetCore(); ASSERT_NE(pModuleConfig, nullptr); bool bResult = pModuleConfig->AddModuleSearchDir("../../bin"); EXPECT_TRUE(bResult); sdv::sequence seqSearchDirs = pModuleConfig->GetModuleSearchDirs(); std::filesystem::path pathModuleDir = (GetExecDirectory() / "../../bin").lexically_normal(); auto itDir = std::find_if(seqSearchDirs.begin(), seqSearchDirs.end(), [&](const sdv::u8string& rssDir) { std::filesystem::path pathDir = static_cast(rssDir); if (pathDir.is_relative()) pathDir = (GetExecDirectory() / pathDir).lexically_normal(); return pathDir == pathModuleDir; }); EXPECT_NE(itDir, seqSearchDirs.end()); } TEST(CoreLibrary_AppControl, SetModuleSearchPathMgntClass) { sdv::app::CAppControl appcontrol; bool bResult = appcontrol.AddModuleSearchDir("../../bin"); EXPECT_TRUE(bResult); }