// SPDX-License-Identifier: GPL-2.0-or-later /** @file * LPE Boolean operation test *//* * Authors: see git history * * Copyright (C) 2020 Authors * * Released under GNU GPL version 2 or later, read the file 'COPYING' for more information */ #include #include #include #include #include #include using namespace Inkscape; using namespace Inkscape::LivePathEffect; class LPEBoolTest : public ::testing::Test { protected: void SetUp() override { // setup hidden dependency Application::create(false); } }; TEST_F(LPEBoolTest, canBeApplyedToNonSiblingPaths) { std::string svg("\ \ \ \ \ \ \ \ \ "); SPDocument *doc = SPDocument::createNewDocFromMem(svg.c_str(), svg.size(), true); doc->ensureUpToDate(); auto lpe_item = dynamic_cast(doc->getObjectById("rect1")); ASSERT_TRUE(lpe_item != nullptr); auto lpe_bool_op_effect = dynamic_cast(lpe_item->getPathEffectOfType(EffectType::BOOL_OP)); ASSERT_TRUE(lpe_bool_op_effect != nullptr); auto operand_path = lpe_bool_op_effect->getParameter("operand-path")->param_getSVGValue(); auto circle = dynamic_cast(doc->getObjectById(operand_path.substr(1))); ASSERT_TRUE(circle != nullptr); }