This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/depsgraph/intern/builder/deg_builder_rna_test.cc
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00

41 lines
1.6 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2020 Blender Foundation. All rights reserved. */
/** \file
* \ingroup depsgraph
*/
#include "intern/builder/deg_builder_rna.h"
#include "testing/testing.h"
namespace blender::deg::tests {
class TestableRNANodeQuery : public RNANodeQuery {
public:
static bool contains(const char *prop_identifier, const char *rna_path_component)
{
return RNANodeQuery::contains(prop_identifier, rna_path_component);
}
};
TEST(deg_builder_rna, contains)
{
EXPECT_TRUE(TestableRNANodeQuery::contains("location", "location"));
EXPECT_TRUE(TestableRNANodeQuery::contains("location.x", "location"));
EXPECT_TRUE(TestableRNANodeQuery::contains("pose.bone[\"blork\"].location", "location"));
EXPECT_TRUE(TestableRNANodeQuery::contains("pose.bone[\"blork\"].location.x", "location"));
EXPECT_TRUE(TestableRNANodeQuery::contains("pose.bone[\"blork\"].location[0]", "location"));
EXPECT_FALSE(TestableRNANodeQuery::contains("", "location"));
EXPECT_FALSE(TestableRNANodeQuery::contains("locatio", "location"));
EXPECT_FALSE(TestableRNANodeQuery::contains("locationnn", "location"));
EXPECT_FALSE(TestableRNANodeQuery::contains("test_location", "location"));
EXPECT_FALSE(TestableRNANodeQuery::contains("location_test", "location"));
EXPECT_FALSE(TestableRNANodeQuery::contains("test_location_test", "location"));
EXPECT_FALSE(TestableRNANodeQuery::contains("pose.bone[\"location\"].scale", "location"));
EXPECT_FALSE(TestableRNANodeQuery::contains("pose.bone[\"location\"].scale[0]", "location"));
}
} // namespace blender::deg::tests