summaryrefslogtreecommitdiffstats
path: root/tools/slang-unit-test
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2024-11-20 20:51:59 -0500
committerGitHub <noreply@github.com>2024-11-20 20:51:59 -0500
commite9caf5de9c0ae137c31c32ea27bc17d7735689a3 (patch)
treee7a1277fda9ae5ecc5980aa4af740985d631781d /tools/slang-unit-test
parent3d36e0ca08c6d8ea21bc825ccfae4754e18744be (diff)
Change how DeclRef::toText works (#5592)
* Change how DeclRef::toText works We now ignore the decl-ref heirarchy since that only includes nodes with specialization info & simply walk up the tree of decls, while emitting any specializations present in the decl-ref. * Update some tests. Add cases for direct refs to generic params & Lookup decl refs
Diffstat (limited to 'tools/slang-unit-test')
-rw-r--r--tools/slang-unit-test/unit-test-decl-tree-reflection.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/slang-unit-test/unit-test-decl-tree-reflection.cpp b/tools/slang-unit-test/unit-test-decl-tree-reflection.cpp
index c8bd9cd02..2ceb9981b 100644
--- a/tools/slang-unit-test/unit-test-decl-tree-reflection.cpp
+++ b/tools/slang-unit-test/unit-test-decl-tree-reflection.cpp
@@ -242,7 +242,6 @@ SLANG_UNIT_TEST(declTreeReflection)
{
auto type = compositeProgram->getLayout()->findTypeByName("MyGenericType<half>");
SLANG_CHECK(type != nullptr);
- // SLANG_CHECK(type->getKind() == slang::DeclReflection::Kind::Struct);
SLANG_CHECK(getTypeFullName(type) == "MyGenericType<half>");
auto funcReflection = compositeProgram->getLayout()->findFunctionByNameInType(type, "g");
SLANG_CHECK(funcReflection != nullptr);
@@ -485,6 +484,12 @@ SLANG_UNIT_TEST(declTreeReflection)
SLANG_CHECK(getTypeFullName(specializedMethodWithFloat->getReturnType()) == "float");
}
+ // Check getTypeFullName() on nested objects.
+ {
+ auto structType = compositeProgram->getLayout()->findTypeByName("MyNamespace::MyStruct");
+ SLANG_CHECK(getTypeFullName(structType) == "MyNamespace.MyStruct");
+ }
+
// Check iterators
{
unsigned int count = 0;