Blender V5.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
8
9#include "BKE_gtest_base.hh"
10
12
13#include "testing/testing.h"
14
16
18 public:
19 static bool contains(const char *prop_identifier, const char *rna_path_component)
20 {
21 return RNANodeQuery::contains(prop_identifier, rna_path_component);
22 }
23};
24
26
28{
29 EXPECT_TRUE(TestableRNANodeQuery::contains("location", "location"));
30 EXPECT_TRUE(TestableRNANodeQuery::contains("location.x", "location"));
31 EXPECT_TRUE(TestableRNANodeQuery::contains("pose.bone[\"blork\"].location", "location"));
32 EXPECT_TRUE(TestableRNANodeQuery::contains("pose.bone[\"blork\"].location.x", "location"));
33 EXPECT_TRUE(TestableRNANodeQuery::contains("pose.bone[\"blork\"].location[0]", "location"));
34
36 EXPECT_FALSE(TestableRNANodeQuery::contains("locatio", "location"));
37 EXPECT_FALSE(TestableRNANodeQuery::contains("locationnn", "location"));
38 EXPECT_FALSE(TestableRNANodeQuery::contains("test_location", "location"));
39 EXPECT_FALSE(TestableRNANodeQuery::contains("location_test", "location"));
40 EXPECT_FALSE(TestableRNANodeQuery::contains("test_location_test", "location"));
41 EXPECT_FALSE(TestableRNANodeQuery::contains("pose.bone[\"location\"].scale", "location"));
42 EXPECT_FALSE(TestableRNANodeQuery::contains("pose.bone[\"location\"].scale[0]", "location"));
43}
44
45} // namespace blender::deg::tests
static bool contains(const char *prop_identifier, const char *rna_path_component)
RNANodeQuery(Depsgraph *depsgraph, DepsgraphBuilder *builder)
static bool contains(const char *prop_identifier, const char *rna_path_component)
#define EXPECT_FALSE(result)
#define EXPECT_TRUE(result)
TEST_F(DegBuilderRNATest, contains)