summaryrefslogtreecommitdiff
path: root/tools/slang-unit-test/unit-test-short-list.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-29 14:49:26 +0800
committerGitHub <noreply@github.com>2024-10-29 14:49:26 +0800
commitf65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch)
treeea1d61342cd29368e19135000ec2948813096205 /tools/slang-unit-test/unit-test-short-list.cpp
parenta729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff)
format
* format * Minor test fixes * enable checking cpp format in ci
Diffstat (limited to 'tools/slang-unit-test/unit-test-short-list.cpp')
-rw-r--r--tools/slang-unit-test/unit-test-short-list.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/tools/slang-unit-test/unit-test-short-list.cpp b/tools/slang-unit-test/unit-test-short-list.cpp
index 2760d633e..9d5de9328 100644
--- a/tools/slang-unit-test/unit-test-short-list.cpp
+++ b/tools/slang-unit-test/unit-test-short-list.cpp
@@ -19,36 +19,36 @@ static bool _checkArrayView(ArrayView<T> v0, ArrayView<T> v1)
SLANG_UNIT_TEST(shortList)
{
{
- ShortList<String, 4> shortList = { "a", "b", "c" };
+ ShortList<String, 4> shortList = {"a", "b", "c"};
shortList.add("d");
auto arrayView = shortList.getArrayView();
SLANG_CHECK(arrayView.ownsStorage == false);
- SLANG_CHECK(_checkArrayView(arrayView.arrayView,
- List<String>{"a", "b", "c", "d"}.getArrayView()));
+ SLANG_CHECK(
+ _checkArrayView(arrayView.arrayView, List<String>{"a", "b", "c", "d"}.getArrayView()));
shortList.add("e");
auto arrayView2 = shortList.getArrayView();
SLANG_CHECK(arrayView2.ownsStorage == true);
- SLANG_CHECK(_checkArrayView(arrayView2.arrayView,
+ SLANG_CHECK(_checkArrayView(
+ arrayView2.arrayView,
List<String>{"a", "b", "c", "d", "e"}.getArrayView()));
auto arrayView3 = shortList.getArrayView(0, 2);
SLANG_CHECK(arrayView3.ownsStorage == false);
- SLANG_CHECK(_checkArrayView(arrayView3.arrayView,
- List<String>{"a", "b"}.getArrayView()));
+ SLANG_CHECK(_checkArrayView(arrayView3.arrayView, List<String>{"a", "b"}.getArrayView()));
auto arrayView4 = shortList.getArrayView(4, 1);
SLANG_CHECK(arrayView4.ownsStorage == false);
- SLANG_CHECK(_checkArrayView(arrayView4.arrayView,
- List<String>{"e"}.getArrayView()));
+ SLANG_CHECK(_checkArrayView(arrayView4.arrayView, List<String>{"e"}.getArrayView()));
auto arrayView5 = shortList.getArrayView(2, 3);
SLANG_CHECK(arrayView5.ownsStorage == true);
- SLANG_CHECK(_checkArrayView(arrayView5.arrayView,
- List<String>{"c", "d", "e"}.getArrayView()));
+ SLANG_CHECK(
+ _checkArrayView(arrayView5.arrayView, List<String>{"c", "d", "e"}.getArrayView()));
ShortList<String, 1> copy2;
ShortList<String, 2> copy1;
copy1 = shortList;
for (auto item : copy1)
copy2.add(item);
- SLANG_CHECK(_checkArrayView(copy2.getArrayView().arrayView,
+ SLANG_CHECK(_checkArrayView(
+ copy2.getArrayView().arrayView,
List<String>{"a", "b", "c", "d", "e"}.getArrayView()));
SLANG_CHECK(copy2.indexOf("a") == 0);
@@ -61,17 +61,20 @@ SLANG_UNIT_TEST(shortList)
copy2.add("f");
copy2.fastRemove("c");
copy2.compress();
- SLANG_CHECK(_checkArrayView(copy2.getArrayView().arrayView,
+ SLANG_CHECK(_checkArrayView(
+ copy2.getArrayView().arrayView,
List<String>{"a", "b", "f", "d", "e"}.getArrayView()));
shortList.removeLast();
shortList.removeLast();
shortList.compress();
- SLANG_CHECK(_checkArrayView(shortList.getArrayView().arrayView,
+ SLANG_CHECK(_checkArrayView(
+ shortList.getArrayView().arrayView,
List<String>{"a", "b", "c"}.getArrayView()));
shortList.add("d");
shortList.add("e");
- SLANG_CHECK(_checkArrayView(shortList.getArrayView().arrayView,
+ SLANG_CHECK(_checkArrayView(
+ shortList.getArrayView().arrayView,
List<String>{"a", "b", "c", "d", "e"}.getArrayView()));
}
}