From f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 29 Oct 2024 14:49:26 +0800 Subject: format * format * Minor test fixes * enable checking cpp format in ci --- .../unit-test-generic-interface-conformance.cpp | 45 ++++++++++++++-------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'tools/slang-unit-test/unit-test-generic-interface-conformance.cpp') diff --git a/tools/slang-unit-test/unit-test-generic-interface-conformance.cpp b/tools/slang-unit-test/unit-test-generic-interface-conformance.cpp index 740d13bef..df5e6e63a 100644 --- a/tools/slang-unit-test/unit-test-generic-interface-conformance.cpp +++ b/tools/slang-unit-test/unit-test-generic-interface-conformance.cpp @@ -1,18 +1,17 @@ // unit-test-translation-unit-import.cpp +#include "../../source/core/slang-io.h" +#include "../../source/core/slang-process.h" +#include "slang-com-ptr.h" #include "slang.h" +#include "tools/unit-test/slang-unit-test.h" #include #include -#include "tools/unit-test/slang-unit-test.h" -#include "slang-com-ptr.h" -#include "../../source/core/slang-io.h" -#include "../../source/core/slang-process.h" - using namespace Slang; -// Test that the IModule::findAndCheckEntryPoint API supports discovering +// Test that the IModule::findAndCheckEntryPoint API supports discovering // entrypoints without a [shader] attribute. SLANG_UNIT_TEST(genericInterfaceConformance) @@ -56,26 +55,38 @@ SLANG_UNIT_TEST(genericInterfaceConformance) sessionDesc.targetCount = 1; sessionDesc.targets = &targetDesc; sessionDesc.allowGLSLSyntax = true; - + ComPtr session; SLANG_CHECK(globalSession->createSession(sessionDesc, session.writeRef()) == SLANG_OK); ComPtr diagnosticBlob; - auto module = session->loadModuleFromSourceString("m", "m.slang", userSourceBody, diagnosticBlob.writeRef()); + auto module = session->loadModuleFromSourceString( + "m", + "m.slang", + userSourceBody, + diagnosticBlob.writeRef()); SLANG_CHECK(module != nullptr); ComPtr entryPoint; - module->findAndCheckEntryPoint("computeMain", SLANG_STAGE_COMPUTE, entryPoint.writeRef(), diagnosticBlob.writeRef()); + module->findAndCheckEntryPoint( + "computeMain", + SLANG_STAGE_COMPUTE, + entryPoint.writeRef(), + diagnosticBlob.writeRef()); SLANG_CHECK(entryPoint != nullptr); ComPtr compositeProgram; - slang::IComponentType* components[] = { module, entryPoint.get() }; - session->createCompositeComponentType(components, 2, compositeProgram.writeRef(), diagnosticBlob.writeRef()); + slang::IComponentType* components[] = {module, entryPoint.get()}; + session->createCompositeComponentType( + components, + 2, + compositeProgram.writeRef(), + diagnosticBlob.writeRef()); SLANG_CHECK(compositeProgram != nullptr); ComPtr typeConformance; - auto result = session->createTypeConformanceComponentType( - compositeProgram->getLayout()->findTypeByName("TestInterfaceImpl"), + auto result = session->createTypeConformanceComponentType( + compositeProgram->getLayout()->findTypeByName("TestInterfaceImpl"), compositeProgram->getLayout()->findTypeByName("ITestInterface"), typeConformance.writeRef(), 3, @@ -84,9 +95,12 @@ SLANG_UNIT_TEST(genericInterfaceConformance) SLANG_CHECK(typeConformance != nullptr); ComPtr compositeProgram2; - slang::IComponentType* components2[] = { compositeProgram.get(), typeConformance.get() }; + slang::IComponentType* components2[] = {compositeProgram.get(), typeConformance.get()}; session->createCompositeComponentType( - components2, 2, compositeProgram2.writeRef(), diagnosticBlob.writeRef()); + components2, + 2, + compositeProgram2.writeRef(), + diagnosticBlob.writeRef()); ComPtr linkedProgram; compositeProgram2->link(linkedProgram.writeRef(), diagnosticBlob.writeRef()); @@ -99,4 +113,3 @@ SLANG_UNIT_TEST(genericInterfaceConformance) auto codeSrc = UnownedStringSlice((const char*)code->getBufferPointer()); SLANG_CHECK(codeSrc.indexOf(toSlice("computeMain")) != -1); } - -- cgit v1.2.3