| 47 | } |
| 48 | |
| 49 | void SetUp() override { |
| 50 | _modelManager = &(Materials::ModelManager::getManager()); |
| 51 | _materialManager = &(Materials::MaterialManager::getManager()); |
| 52 | |
| 53 | // Use our test files as a custom directory |
| 54 | ParameterGrp::handle hGrp = |
| 55 | App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Material/Resources"); |
| 56 | |
| 57 | _customDir = hGrp->GetASCII("CustomMaterialsDir", ""); |
| 58 | _useBuiltInDir = hGrp->GetBool("UseBuiltInMaterials", true); |
| 59 | _useWorkbenchDir = hGrp->GetBool("UseMaterialsFromWorkbenches", true); |
| 60 | _useUserDir = hGrp->GetBool("UseMaterialsFromConfigDir", true); |
| 61 | _useCustomDir = hGrp->GetBool("UseMaterialsFromCustomDir", false); |
| 62 | |
| 63 | std::string testPath = App::Application::getHomePath() + "/tests/Materials/"; |
| 64 | hGrp->SetASCII("CustomMaterialsDir", testPath); |
| 65 | hGrp->SetBool("UseBuiltInMaterials", false); |
| 66 | hGrp->SetBool("UseMaterialsFromWorkbenches", false); |
| 67 | hGrp->SetBool("UseMaterialsFromConfigDir", false); |
| 68 | hGrp->SetBool("UseMaterialsFromCustomDir", true); |
| 69 | |
| 70 | auto param = App::GetApplication().GetParameterGroupByPath( |
| 71 | "User parameter:BaseApp/Preferences/Mod/Material/Editor"); |
| 72 | param->SetBool("ShowFavorites", true); |
| 73 | param->SetBool("ShowRecent", true); |
| 74 | param->SetBool("ShowEmptyFolders", false); |
| 75 | param->SetBool("ShowEmptyLibraries", true); |
| 76 | param->SetBool("ShowLegacy", false); |
| 77 | |
| 78 | _materialManager->refresh(); |
| 79 | |
| 80 | _library = _materialManager->getLibrary(QStringLiteral("Custom")); |
| 81 | } |
| 82 | |
| 83 | void TearDown() override { |
| 84 | ParameterGrp::handle hGrp = |
nothing calls this directly
no test coverage detected