Blender  V3.3
deg_builder_rna_test.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2020 Blender Foundation. All rights reserved. */
3 
9 
10 #include "testing/testing.h"
11 
13 
15  public:
16  static bool contains(const char *prop_identifier, const char *rna_path_component)
17  {
18  return RNANodeQuery::contains(prop_identifier, rna_path_component);
19  }
20 };
21 
22 TEST(deg_builder_rna, contains)
23 {
24  EXPECT_TRUE(TestableRNANodeQuery::contains("location", "location"));
25  EXPECT_TRUE(TestableRNANodeQuery::contains("location.x", "location"));
26  EXPECT_TRUE(TestableRNANodeQuery::contains("pose.bone[\"blork\"].location", "location"));
27  EXPECT_TRUE(TestableRNANodeQuery::contains("pose.bone[\"blork\"].location.x", "location"));
28  EXPECT_TRUE(TestableRNANodeQuery::contains("pose.bone[\"blork\"].location[0]", "location"));
29 
30  EXPECT_FALSE(TestableRNANodeQuery::contains("", "location"));
31  EXPECT_FALSE(TestableRNANodeQuery::contains("locatio", "location"));
32  EXPECT_FALSE(TestableRNANodeQuery::contains("locationnn", "location"));
33  EXPECT_FALSE(TestableRNANodeQuery::contains("test_location", "location"));
34  EXPECT_FALSE(TestableRNANodeQuery::contains("location_test", "location"));
35  EXPECT_FALSE(TestableRNANodeQuery::contains("test_location_test", "location"));
36  EXPECT_FALSE(TestableRNANodeQuery::contains("pose.bone[\"location\"].scale", "location"));
37  EXPECT_FALSE(TestableRNANodeQuery::contains("pose.bone[\"location\"].scale[0]", "location"));
38 }
39 
40 } // 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)
bool contains(const void *owner, const blender::bke::AttributeIDRef &attribute_id)
TEST(deg_builder_rna, contains)