Blender V4.3
deg_builder_rna_test.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2020 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include "testing/testing.h"
12
14
16 public:
17 static bool contains(const char *prop_identifier, const char *rna_path_component)
18 {
19 return RNANodeQuery::contains(prop_identifier, rna_path_component);
20 }
21};
22
23TEST(deg_builder_rna, contains)
24{
25 EXPECT_TRUE(TestableRNANodeQuery::contains("location", "location"));
26 EXPECT_TRUE(TestableRNANodeQuery::contains("location.x", "location"));
27 EXPECT_TRUE(TestableRNANodeQuery::contains("pose.bone[\"blork\"].location", "location"));
28 EXPECT_TRUE(TestableRNANodeQuery::contains("pose.bone[\"blork\"].location.x", "location"));
29 EXPECT_TRUE(TestableRNANodeQuery::contains("pose.bone[\"blork\"].location[0]", "location"));
30
31 EXPECT_FALSE(TestableRNANodeQuery::contains("", "location"));
32 EXPECT_FALSE(TestableRNANodeQuery::contains("locatio", "location"));
33 EXPECT_FALSE(TestableRNANodeQuery::contains("locationnn", "location"));
34 EXPECT_FALSE(TestableRNANodeQuery::contains("test_location", "location"));
35 EXPECT_FALSE(TestableRNANodeQuery::contains("location_test", "location"));
36 EXPECT_FALSE(TestableRNANodeQuery::contains("test_location_test", "location"));
37 EXPECT_FALSE(TestableRNANodeQuery::contains("pose.bone[\"location\"].scale", "location"));
38 EXPECT_FALSE(TestableRNANodeQuery::contains("pose.bone[\"location\"].scale[0]", "location"));
39}
40
41} // namespace blender::deg::tests
static bool contains(const char *prop_identifier, const char *rna_path_component)
static bool contains(const char *prop_identifier, const char *rna_path_component)
TEST(deg_builder_rna, contains)