From ac657bee0142f96fcd3fa5d56455658834a19b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 12 Oct 2021 11:22:48 +0200 Subject: Tests: simplify asset catalog tree testing code Simplify the testing code that verifies the asset catalog tree. It now prints clearer error messages when things go wrong, and it gets simpler data to test (instead of having to explicitly pass the parent count, it just counts the number of separators in the expected path). No functional changes to Blender. --- source/blender/blenkernel/BKE_asset_catalog_path.hh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/blenkernel/BKE_asset_catalog_path.hh') diff --git a/source/blender/blenkernel/BKE_asset_catalog_path.hh b/source/blender/blenkernel/BKE_asset_catalog_path.hh index 328625b1bfa..054b7853140 100644 --- a/source/blender/blenkernel/BKE_asset_catalog_path.hh +++ b/source/blender/blenkernel/BKE_asset_catalog_path.hh @@ -76,6 +76,9 @@ class AssetCatalogPath { const char *c_str() const; const std::string &str() const; + /* The last path component, used as label in the tree view. */ + StringRefNull name() const; + /* In-class operators, because of the implicit `AssetCatalogPath(StringRef)` constructor. * Otherwise `string == string` could cast both sides to `AssetCatalogPath`. */ bool operator==(const AssetCatalogPath &other_path) const; -- cgit v1.2.3