From cd11e4a05a3586d1cba3f2f066258221e6e21703 Mon Sep 17 00:00:00 2001 From: Nikhil2206 Date: Fri, 11 Sep 2026 08:02:00 +0000 Subject: [PATCH 1/4] string_manipulation: add requirements and test links --- BUILD | 4 + docs/baselibs/components/index.rst | 3 + score/string_manipulation/BUILD | 7 ++ .../arguments/arguments_test.cpp | 8 ++ score/string_manipulation/docs/index.rst | 33 ++++++ .../docs/requirements/index.rst | 64 ++++++++++ .../split_string_view_test.cpp | 32 +++++ .../string_comparison_adaptor_test.cpp | 110 ++++++++++++++++++ 8 files changed, 261 insertions(+) create mode 100644 score/string_manipulation/docs/index.rst create mode 100644 score/string_manipulation/docs/requirements/index.rst diff --git a/BUILD b/BUILD index 492e70606c..f879d6f0fe 100644 --- a/BUILD +++ b/BUILD @@ -82,6 +82,10 @@ docs( "bundle": "//score/result:docs", "mount_at": "baselibs/components/result", }, + { + "bundle": "//score/string_manipulation:docs", + "mount_at": "baselibs/components/string_manipulation", + }, { "bundle": "//score/static_reflection_with_serialization:docs", "mount_at": "baselibs/components/static_reflection_with_serialization", diff --git a/docs/baselibs/components/index.rst b/docs/baselibs/components/index.rst index 75aac0dcd8..2f2a5ff5ef 100644 --- a/docs/baselibs/components/index.rst +++ b/docs/baselibs/components/index.rst @@ -19,6 +19,7 @@ Components :maxdepth: 1 abi_compatible_data_types/docs/index + string_manipulation/docs/index Overview @@ -55,3 +56,5 @@ Overview - *mw::log*: Logging frontend. - :need:`doc__utils`: Provides a collection of small, reusable utilities that do not fit into the other base libraries. +- :need:`doc__string_manipulation`: Provides allocation-conscious helpers for command-line arguments, + lazy string-view splitting, and string-like comparison and hashing. diff --git a/score/string_manipulation/BUILD b/score/string_manipulation/BUILD index 79670c946e..0b21cce902 100644 --- a/score/string_manipulation/BUILD +++ b/score/string_manipulation/BUILD @@ -14,6 +14,7 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") load("@score_baselibs//score/language/safecpp:toolchain_features.bzl", "COMPILER_WARNING_FEATURES") load("@score_baselibs//score/quality/clang_tidy:extra_checks.bzl", "clang_tidy_extra_checks") +load("@score_docs_as_code//:docs.bzl", "docs_bundle") clang_tidy_extra_checks( name = "clang_tidy_extra_checks", @@ -106,3 +107,9 @@ cc_test( "@googletest//:gtest_main", ], ) + +docs_bundle( + name = "docs", + source_dir = "docs", + visibility = ["//visibility:public"], +) diff --git a/score/string_manipulation/arguments/arguments_test.cpp b/score/string_manipulation/arguments/arguments_test.cpp index 3427a72a4c..5bfa8c2735 100644 --- a/score/string_manipulation/arguments/arguments_test.cpp +++ b/score/string_manipulation/arguments/arguments_test.cpp @@ -17,6 +17,10 @@ TEST(GetArguments, ReturnsEmptyVectorWhenNoArguments) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__argument_conversion"); + RecordProperty("Description", "Check that an empty argument list produces an empty vector of string views."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "boundary-values"); constexpr int kArgc = 0; const char* argv[] = {nullptr}; auto arguments = score::string_manipulation::GetArguments(kArgc, argv); @@ -25,6 +29,10 @@ TEST(GetArguments, ReturnsEmptyVectorWhenNoArguments) TEST(GetArguments, ReturnsVectorWithProvidedArguments) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__argument_conversion"); + RecordProperty("Description", "Check that supplied command-line arguments are preserved in order as string views."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); constexpr int kArgc = 2; const char* argv[] = {"first", "second", nullptr}; auto arguments = score::string_manipulation::GetArguments(kArgc, argv); diff --git a/score/string_manipulation/docs/index.rst b/score/string_manipulation/docs/index.rst new file mode 100644 index 0000000000..61140d2502 --- /dev/null +++ b/score/string_manipulation/docs/index.rst @@ -0,0 +1,33 @@ +.. + # ******************************************************************************* + # Copyright (c) 2026 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +String Manipulation +################### + +.. document:: String Manipulation + :id: doc__string_manipulation + :status: draft + :version: 1 + :safety: ASIL_B + :security: YES + :realizes: wp__cmpt_request[version==1] + +.. toctree:: + :hidden: + + requirements/index.rst + +The String Manipulation component provides allocation-conscious helpers for +handling command-line arguments, splitting string views, and comparing +string-like values. \ No newline at end of file diff --git a/score/string_manipulation/docs/requirements/index.rst b/score/string_manipulation/docs/requirements/index.rst new file mode 100644 index 0000000000..35f1fb8f67 --- /dev/null +++ b/score/string_manipulation/docs/requirements/index.rst @@ -0,0 +1,64 @@ +.. + # ******************************************************************************* + # Copyright (c) 2026 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +Requirements +############ + +.. document:: String Manipulation Requirements + :id: doc__string_manipulation_requirements + :status: draft + :version: 1 + :safety: ASIL_B + :security: YES + :realizes: wp__requirements_comp[version==1] + :tags: requirements, string_manipulation + +Functional Requirements +======================= + +.. comp_req:: Argument Conversion + :id: comp_req__string_manipulation__argument_conversion + :reqtype: Functional + :security: YES + :safety: ASIL_B + :derived_from: feat_req__baselibs__utils_library[version==2] + :status: valid + :version: 1 + :tags: inspected + + The String Manipulation component shall provide an operation that converts a command-line argument array into an ordered collection of null-terminated string views. + +.. comp_req:: Lazy String Splitting + :id: comp_req__string_manipulation__lazy_string_splitting + :reqtype: Functional + :security: YES + :safety: ASIL_B + :derived_from: feat_req__baselibs__utils_library[version==2] + :status: valid + :version: 1 + :tags: inspected + + The String Manipulation component shall provide a forward-iterable operation that lazily splits a string view on a delimiter, preserves empty substrings required by delimiter placement, and performs no dynamic memory allocation. + +.. comp_req:: String-Like Comparison and Hashing + :id: comp_req__string_manipulation__string_like_comparison_hashing + :reqtype: Functional + :security: YES + :safety: ASIL_B + :derived_from: feat_req__baselibs__utils_library[version==2] + :status: valid + :version: 1 + :tags: inspected + + The String Manipulation component shall provide a string-like adaptor that accepts supported string representations, exposes their content as a string view, compares by content, and produces equal hashes for equal content. \ No newline at end of file diff --git a/score/string_manipulation/split_string_view_test.cpp b/score/string_manipulation/split_string_view_test.cpp index a2a653da4b..a903ff7fd5 100644 --- a/score/string_manipulation/split_string_view_test.cpp +++ b/score/string_manipulation/split_string_view_test.cpp @@ -63,18 +63,30 @@ void ExpectEqualSequences(const StringSequence& lhs, const StringSequence& rhs) TEST(StringSplitterTests, EmptyStringShallReturnEmptyRange) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("Description", "Check that splitting an empty string produces an empty range."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "boundary-values"); LazySplitStringView splitter{"", kSeperator}; EXPECT_TRUE(splitter.begin() == splitter.end()); } TEST(StringSplitterTests, NoSeperatorShallReturnOneItem) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("Description", "Check that a string without delimiters is returned as one substring view."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); StringSequence seq{"Hello World"sv}; ExpectEqualSequences(GetSplitSequence(Join(seq)), seq); } TEST(StringSplitterTests, OneSeperatorShallReturnTwoItems) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("Description", "Check that one delimiter separates the input into two substring views."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); StringSequence seq{"Hello World"sv, "Foobar"sv}; ExpectEqualSequences(GetSplitSequence(Join(seq)), seq); @@ -82,6 +94,10 @@ TEST(StringSplitterTests, OneSeperatorShallReturnTwoItems) TEST(StringSplitterTests, SeperatorAtBeginShallReturnEmptyString) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("Description", "Check that a leading delimiter produces an empty first substring."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "boundary-values"); StringSequence seq{""sv, "Hello World"sv, "Foobar"sv}; ExpectEqualSequences(GetSplitSequence(Join(seq)), seq); @@ -89,6 +105,10 @@ TEST(StringSplitterTests, SeperatorAtBeginShallReturnEmptyString) TEST(StringSplitterTests, SeperatorAtEndShallBeDiscarded) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("Description", "Check that a trailing delimiter does not create an additional substring."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "boundary-values"); StringSequence seq{"Hello World"sv, "Foobar"sv}; ExpectEqualSequences(GetSplitSequence(Join(seq) + kSeperator), seq); @@ -96,16 +116,28 @@ TEST(StringSplitterTests, SeperatorAtEndShallBeDiscarded) TEST(StringSplitterTests, SeperatorOnlyStringShallReturnEmptySubstring) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("Description", "Check that an input consisting only of the delimiter yields one empty view."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "boundary-values"); ExpectEqualSequences(GetSplitSequence(std::string{"|"}), StringSequence{""sv}); } TEST(StringSplitterTests, TwoSeperatorsShallReturnTwoEmptySubstring) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("Description", "Check that two consecutive delimiters yield two empty substring views."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "boundary-values"); ExpectEqualSequences(GetSplitSequence(std::string{"||"}), StringSequence{""sv, ""sv}); } TEST(StringSplitterTests, MultipleSeperatorsInRowShallReturnEmptySubstring) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("Description", "Check that repeated delimiters preserve the empty substring between them."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "boundary-values"); ExpectEqualSequences(GetSplitSequence(std::string{"Foo||Bar"}), StringSequence{"Foo"sv, ""sv, "Bar"sv}); } diff --git a/score/string_manipulation/string_comparison_adaptor_test.cpp b/score/string_manipulation/string_comparison_adaptor_test.cpp index 9674f2e901..b99a20be25 100644 --- a/score/string_manipulation/string_comparison_adaptor_test.cpp +++ b/score/string_manipulation/string_comparison_adaptor_test.cpp @@ -66,17 +66,32 @@ TYPED_TEST_SUITE(StringComparisonAdaptorFixture, MyTypes, ); TEST(StringComparisonAdaptorHelpersFixture, CreateUnderlyingStringReturnCorrectValues) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that the test helper creates equivalent string and string-view content."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); EXPECT_THAT(CreateUnderlyingString("test_string"), "test_string"); EXPECT_THAT(CreateUnderlyingString("test_string").data(), StrEq("test_string")); } TYPED_TEST(StringComparisonAdaptorFixture, CanBeConvertedImplicitly) { + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty("Description", + "Check that each supported string representation converts implicitly to the adaptor."); + this->RecordProperty("TestType", "interface-test"); + this->RecordProperty("DerivationTechnique", "equivalence-classes"); EXPECT_THAT((std::is_convertible::value), IsTrue()); } TYPED_TEST(StringComparisonAdaptorFixture, CanBeCopyConstructed) { + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty( + "Description", + "Check that constructing an adaptor from a supported string representation preserves its content."); + this->RecordProperty("TestType", "requirements-based"); + this->RecordProperty("DerivationTechnique", "equivalence-classes"); const auto underlying_string = CreateUnderlyingString("b"); StringComparisonAdaptor adaptor{underlying_string}; EXPECT_THAT(adaptor, Eq(underlying_string)); @@ -84,6 +99,11 @@ TYPED_TEST(StringComparisonAdaptorFixture, CanBeCopyConstructed) TYPED_TEST(StringComparisonAdaptorFixture, CanBeCopyAssigned) { + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty("Description", + "Check that assigning a supported string representation updates the adaptor content."); + this->RecordProperty("TestType", "requirements-based"); + this->RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor{"a"}; const auto underlying_string = CreateUnderlyingString("b"); adaptor = underlying_string; @@ -92,6 +112,11 @@ TYPED_TEST(StringComparisonAdaptorFixture, CanBeCopyAssigned) TYPED_TEST(StringComparisonAdaptorFixture, GetStringViewReturnsValidStringView) { + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty("Description", + "Check that the adaptor exposes its stored content as the expected string view."); + this->RecordProperty("TestType", "interface-test"); + this->RecordProperty("DerivationTechnique", "equivalence-classes"); const auto underlying_string = CreateUnderlyingString("a"); StringComparisonAdaptor adaptor{underlying_string}; @@ -100,6 +125,10 @@ TYPED_TEST(StringComparisonAdaptorFixture, GetStringViewReturnsValidStringView) TYPED_TEST(StringComparisonAdaptorFixture, ComparisonReturnsTrueForSameContent) { + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty("Description", "Check that an adaptor compares equal to a string with identical content."); + this->RecordProperty("TestType", "requirements-based"); + this->RecordProperty("DerivationTechnique", "equivalence-classes"); const auto underlying_string = CreateUnderlyingString("a"); StringComparisonAdaptor adaptor{underlying_string}; EXPECT_THAT(adaptor, Eq("a")); @@ -107,6 +136,10 @@ TYPED_TEST(StringComparisonAdaptorFixture, ComparisonReturnsTrueForSameContent) TYPED_TEST(StringComparisonAdaptorFixture, ComparisonReturnsFalseForDifferentContent) { + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty("Description", "Check that adaptors with different content compare unequal."); + this->RecordProperty("TestType", "requirements-based"); + this->RecordProperty("DerivationTechnique", "equivalence-classes"); const auto underlying_string_1 = CreateUnderlyingString("a"); StringComparisonAdaptor adaptor{underlying_string_1}; @@ -116,6 +149,12 @@ TYPED_TEST(StringComparisonAdaptorFixture, ComparisonReturnsFalseForDifferentCon TYPED_TEST(StringComparisonAdaptorFixture, HashIsSameForTwoEqualAdaptors) { + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty( + "Description", + "Check that equal adaptor content produces equal hash values for both supported representations."); + this->RecordProperty("TestType", "requirements-based"); + this->RecordProperty("DerivationTechnique", "equivalence-classes"); const auto underlying_string_1 = CreateUnderlyingString("a"); StringComparisonAdaptor adaptor1{underlying_string_1}; @@ -126,6 +165,11 @@ TYPED_TEST(StringComparisonAdaptorFixture, HashIsSameForTwoEqualAdaptors) TEST(StringComparisonAdaptor, CanBeCopyConstructedWithAdaptor) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", + "Check that copying an adaptor preserves its content and keeps the instances independent."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor1{"a"}; StringComparisonAdaptor adaptor2{adaptor1}; @@ -139,6 +183,10 @@ TEST(StringComparisonAdaptor, CanBeCopyConstructedWithAdaptor) TEST(StringComparisonAdaptor, CanBeMoveConstructedWithAdaptor) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that moving an adaptor transfers its string-like content to the destination."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor1{"a"}; StringComparisonAdaptor adaptor2{std::move(adaptor1)}; @@ -147,6 +195,10 @@ TEST(StringComparisonAdaptor, CanBeMoveConstructedWithAdaptor) TEST(StringComparisonAdaptorWithString, CanBeMoveConstructed) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that moving a string into the adaptor preserves the original content."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str{"b"}; StringComparisonAdaptor adaptor{std::move(str)}; EXPECT_THAT(adaptor, Eq(std::string{"b"})); @@ -154,6 +206,10 @@ TEST(StringComparisonAdaptorWithString, CanBeMoveConstructed) TEST(StringComparisonAdaptorWithString, CanBeMoveAssigned) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that move assignment from a string replaces the adaptor content."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor{"a"}; std::string str{"b"}; adaptor = std::move(str); @@ -162,6 +218,11 @@ TEST(StringComparisonAdaptorWithString, CanBeMoveAssigned) TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStringAndStringView) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", + "Check that equal string and string-view content compares equal through the adaptor."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str{"a"}; StringComparisonAdaptor adaptor{str}; @@ -171,6 +232,10 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStr TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStringAndCString) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that adaptor content compares equal with an equivalent C string."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str{"a"}; StringComparisonAdaptor adaptor{str}; @@ -179,6 +244,11 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStr TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStringViewAndString) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", + "Check that equal string-view and string content compares equal through the adaptor."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str{"a"}; std::string_view str_view{str}; StringComparisonAdaptor adaptor{str_view}; @@ -188,6 +258,10 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStr TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStringViewAndCString) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that string-view adaptor content compares equal with an equivalent C string."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str{"a"}; std::string_view str_view{str}; StringComparisonAdaptor adaptor{str_view}; @@ -197,6 +271,10 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStr TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenCStringAndString) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that C-string adaptor content compares equal with an equivalent string."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor{"a"}; std::string str{"a"}; @@ -205,6 +283,10 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenCSt TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenCStringAndStringView) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that C-string adaptor content compares equal with an equivalent string view."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor{"a"}; std::string str{"a"}; @@ -214,6 +296,10 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenCSt TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringAndStringView) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that equal string and string-view content produces the same adaptor hash."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str1{"a"}; StringComparisonAdaptor adaptor1{str1}; @@ -225,6 +311,10 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringA TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringAndCString) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that equal string and C-string content produces the same adaptor hash."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str1{"a"}; StringComparisonAdaptor adaptor1{str1}; @@ -234,6 +324,10 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringA TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringViewAndString) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that equal string-view and string content produces the same adaptor hash."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str1{"a"}; std::string_view str_view1{str1}; StringComparisonAdaptor adaptor1{str_view1}; @@ -245,6 +339,10 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringV TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringViewAndCString) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that equal string-view and C-string content produces the same adaptor hash."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str1{"a"}; std::string_view str_view1{str1}; StringComparisonAdaptor adaptor1{str_view1}; @@ -255,6 +353,10 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringV TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForCStringViewAndString) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that equal C-string and string content produces the same adaptor hash."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor1{"a"}; std::string str{"a"}; @@ -264,6 +366,10 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForCStringViewA TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualCStringAndStringView) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that equal C-string and string-view content produces the same adaptor hash."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor1{"a"}; std::string string{"a"}; @@ -275,6 +381,10 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualCString TEST(StringComparisonAdaptorLessComparison, LessThan) { + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("Description", "Check that the adaptor orders string content lexicographically."); + RecordProperty("TestType", "requirements-based"); + RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor1{"ab"}; StringComparisonAdaptor adaptor2{"ac"}; EXPECT_EQ(adaptor1 < adaptor2, true); From 835356f3285557b9e42a1d47fc02cc40a38d71e8 Mon Sep 17 00:00:00 2001 From: Nikhil2206 Date: Fri, 11 Sep 2026 08:56:17 +0000 Subject: [PATCH 2/4] string manipulation: complete requirement traceability --- docs/baselibs/components/index.rst | 1 - .../arguments/arguments_test.cpp | 4 +- .../docs/architecture/index.rst | 34 +++++++++++++ score/string_manipulation/docs/index.rst | 1 + .../docs/requirements/index.rst | 9 ++-- .../split_string_view_test.cpp | 16 +++--- .../string_comparison_adaptor_test.cpp | 50 +++++++++---------- 7 files changed, 76 insertions(+), 39 deletions(-) create mode 100644 score/string_manipulation/docs/architecture/index.rst diff --git a/docs/baselibs/components/index.rst b/docs/baselibs/components/index.rst index 2f2a5ff5ef..78a5ca924c 100644 --- a/docs/baselibs/components/index.rst +++ b/docs/baselibs/components/index.rst @@ -19,7 +19,6 @@ Components :maxdepth: 1 abi_compatible_data_types/docs/index - string_manipulation/docs/index Overview diff --git a/score/string_manipulation/arguments/arguments_test.cpp b/score/string_manipulation/arguments/arguments_test.cpp index 5bfa8c2735..bb62bd66c1 100644 --- a/score/string_manipulation/arguments/arguments_test.cpp +++ b/score/string_manipulation/arguments/arguments_test.cpp @@ -17,7 +17,7 @@ TEST(GetArguments, ReturnsEmptyVectorWhenNoArguments) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__argument_conversion"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__args_conv"); RecordProperty("Description", "Check that an empty argument list produces an empty vector of string views."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "boundary-values"); @@ -29,7 +29,7 @@ TEST(GetArguments, ReturnsEmptyVectorWhenNoArguments) TEST(GetArguments, ReturnsVectorWithProvidedArguments) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__argument_conversion"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__args_conv"); RecordProperty("Description", "Check that supplied command-line arguments are preserved in order as string views."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); diff --git a/score/string_manipulation/docs/architecture/index.rst b/score/string_manipulation/docs/architecture/index.rst new file mode 100644 index 0000000000..2041ce7bd1 --- /dev/null +++ b/score/string_manipulation/docs/architecture/index.rst @@ -0,0 +1,34 @@ +.. + # ******************************************************************************* + # Copyright (c) 2026 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +String Manipulation Architecture +################################# + +.. document:: String Manipulation Architecture + :id: doc__string_manipulation_architecture + :status: draft + :version: 1 + :safety: ASIL_B + :security: YES + :realizes: wp__component_arch[version==1] + +.. comp:: String Manipulation + :id: comp__baselibs_string_manipulation + :security: YES + :safety: ASIL_B + :status: valid + :version: 1 + :belongs_to: feat__baselibs[version==1] + + The String Manipulation component contains helpers for command-line arguments, string-view splitting, and string-like comparisons. \ No newline at end of file diff --git a/score/string_manipulation/docs/index.rst b/score/string_manipulation/docs/index.rst index 61140d2502..f611efc893 100644 --- a/score/string_manipulation/docs/index.rst +++ b/score/string_manipulation/docs/index.rst @@ -27,6 +27,7 @@ String Manipulation :hidden: requirements/index.rst + architecture/index.rst The String Manipulation component provides allocation-conscious helpers for handling command-line arguments, splitting string views, and comparing diff --git a/score/string_manipulation/docs/requirements/index.rst b/score/string_manipulation/docs/requirements/index.rst index 35f1fb8f67..48f15514fa 100644 --- a/score/string_manipulation/docs/requirements/index.rst +++ b/score/string_manipulation/docs/requirements/index.rst @@ -28,7 +28,7 @@ Functional Requirements ======================= .. comp_req:: Argument Conversion - :id: comp_req__string_manipulation__argument_conversion + :id: comp_req__string_manipulation__args_conv :reqtype: Functional :security: YES :safety: ASIL_B @@ -36,11 +36,12 @@ Functional Requirements :status: valid :version: 1 :tags: inspected + :satisfied_by: comp__baselibs_string_manipulation[version==1] The String Manipulation component shall provide an operation that converts a command-line argument array into an ordered collection of null-terminated string views. .. comp_req:: Lazy String Splitting - :id: comp_req__string_manipulation__lazy_string_splitting + :id: comp_req__string_manipulation__lazy_split :reqtype: Functional :security: YES :safety: ASIL_B @@ -48,11 +49,12 @@ Functional Requirements :status: valid :version: 1 :tags: inspected + :satisfied_by: comp__baselibs_string_manipulation[version==1] The String Manipulation component shall provide a forward-iterable operation that lazily splits a string view on a delimiter, preserves empty substrings required by delimiter placement, and performs no dynamic memory allocation. .. comp_req:: String-Like Comparison and Hashing - :id: comp_req__string_manipulation__string_like_comparison_hashing + :id: comp_req__string_manipulation__cmp_hash :reqtype: Functional :security: YES :safety: ASIL_B @@ -60,5 +62,6 @@ Functional Requirements :status: valid :version: 1 :tags: inspected + :satisfied_by: comp__baselibs_string_manipulation[version==1] The String Manipulation component shall provide a string-like adaptor that accepts supported string representations, exposes their content as a string view, compares by content, and produces equal hashes for equal content. \ No newline at end of file diff --git a/score/string_manipulation/split_string_view_test.cpp b/score/string_manipulation/split_string_view_test.cpp index a903ff7fd5..edeb3f7fda 100644 --- a/score/string_manipulation/split_string_view_test.cpp +++ b/score/string_manipulation/split_string_view_test.cpp @@ -63,7 +63,7 @@ void ExpectEqualSequences(const StringSequence& lhs, const StringSequence& rhs) TEST(StringSplitterTests, EmptyStringShallReturnEmptyRange) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); RecordProperty("Description", "Check that splitting an empty string produces an empty range."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "boundary-values"); @@ -73,7 +73,7 @@ TEST(StringSplitterTests, EmptyStringShallReturnEmptyRange) TEST(StringSplitterTests, NoSeperatorShallReturnOneItem) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); RecordProperty("Description", "Check that a string without delimiters is returned as one substring view."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -83,7 +83,7 @@ TEST(StringSplitterTests, NoSeperatorShallReturnOneItem) TEST(StringSplitterTests, OneSeperatorShallReturnTwoItems) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); RecordProperty("Description", "Check that one delimiter separates the input into two substring views."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -94,7 +94,7 @@ TEST(StringSplitterTests, OneSeperatorShallReturnTwoItems) TEST(StringSplitterTests, SeperatorAtBeginShallReturnEmptyString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); RecordProperty("Description", "Check that a leading delimiter produces an empty first substring."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "boundary-values"); @@ -105,7 +105,7 @@ TEST(StringSplitterTests, SeperatorAtBeginShallReturnEmptyString) TEST(StringSplitterTests, SeperatorAtEndShallBeDiscarded) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); RecordProperty("Description", "Check that a trailing delimiter does not create an additional substring."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "boundary-values"); @@ -116,7 +116,7 @@ TEST(StringSplitterTests, SeperatorAtEndShallBeDiscarded) TEST(StringSplitterTests, SeperatorOnlyStringShallReturnEmptySubstring) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); RecordProperty("Description", "Check that an input consisting only of the delimiter yields one empty view."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "boundary-values"); @@ -125,7 +125,7 @@ TEST(StringSplitterTests, SeperatorOnlyStringShallReturnEmptySubstring) TEST(StringSplitterTests, TwoSeperatorsShallReturnTwoEmptySubstring) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); RecordProperty("Description", "Check that two consecutive delimiters yield two empty substring views."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "boundary-values"); @@ -134,7 +134,7 @@ TEST(StringSplitterTests, TwoSeperatorsShallReturnTwoEmptySubstring) TEST(StringSplitterTests, MultipleSeperatorsInRowShallReturnEmptySubstring) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_string_splitting"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); RecordProperty("Description", "Check that repeated delimiters preserve the empty substring between them."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "boundary-values"); diff --git a/score/string_manipulation/string_comparison_adaptor_test.cpp b/score/string_manipulation/string_comparison_adaptor_test.cpp index b99a20be25..41faa3c61c 100644 --- a/score/string_manipulation/string_comparison_adaptor_test.cpp +++ b/score/string_manipulation/string_comparison_adaptor_test.cpp @@ -66,7 +66,7 @@ TYPED_TEST_SUITE(StringComparisonAdaptorFixture, MyTypes, ); TEST(StringComparisonAdaptorHelpersFixture, CreateUnderlyingStringReturnCorrectValues) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that the test helper creates equivalent string and string-view content."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -76,7 +76,7 @@ TEST(StringComparisonAdaptorHelpersFixture, CreateUnderlyingStringReturnCorrectV TYPED_TEST(StringComparisonAdaptorFixture, CanBeConvertedImplicitly) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); this->RecordProperty("Description", "Check that each supported string representation converts implicitly to the adaptor."); this->RecordProperty("TestType", "interface-test"); @@ -86,7 +86,7 @@ TYPED_TEST(StringComparisonAdaptorFixture, CanBeConvertedImplicitly) TYPED_TEST(StringComparisonAdaptorFixture, CanBeCopyConstructed) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); this->RecordProperty( "Description", "Check that constructing an adaptor from a supported string representation preserves its content."); @@ -99,7 +99,7 @@ TYPED_TEST(StringComparisonAdaptorFixture, CanBeCopyConstructed) TYPED_TEST(StringComparisonAdaptorFixture, CanBeCopyAssigned) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); this->RecordProperty("Description", "Check that assigning a supported string representation updates the adaptor content."); this->RecordProperty("TestType", "requirements-based"); @@ -112,7 +112,7 @@ TYPED_TEST(StringComparisonAdaptorFixture, CanBeCopyAssigned) TYPED_TEST(StringComparisonAdaptorFixture, GetStringViewReturnsValidStringView) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); this->RecordProperty("Description", "Check that the adaptor exposes its stored content as the expected string view."); this->RecordProperty("TestType", "interface-test"); @@ -125,7 +125,7 @@ TYPED_TEST(StringComparisonAdaptorFixture, GetStringViewReturnsValidStringView) TYPED_TEST(StringComparisonAdaptorFixture, ComparisonReturnsTrueForSameContent) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); this->RecordProperty("Description", "Check that an adaptor compares equal to a string with identical content."); this->RecordProperty("TestType", "requirements-based"); this->RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -136,7 +136,7 @@ TYPED_TEST(StringComparisonAdaptorFixture, ComparisonReturnsTrueForSameContent) TYPED_TEST(StringComparisonAdaptorFixture, ComparisonReturnsFalseForDifferentContent) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); this->RecordProperty("Description", "Check that adaptors with different content compare unequal."); this->RecordProperty("TestType", "requirements-based"); this->RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -149,7 +149,7 @@ TYPED_TEST(StringComparisonAdaptorFixture, ComparisonReturnsFalseForDifferentCon TYPED_TEST(StringComparisonAdaptorFixture, HashIsSameForTwoEqualAdaptors) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); this->RecordProperty( "Description", "Check that equal adaptor content produces equal hash values for both supported representations."); @@ -165,7 +165,7 @@ TYPED_TEST(StringComparisonAdaptorFixture, HashIsSameForTwoEqualAdaptors) TEST(StringComparisonAdaptor, CanBeCopyConstructedWithAdaptor) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that copying an adaptor preserves its content and keeps the instances independent."); RecordProperty("TestType", "requirements-based"); @@ -183,7 +183,7 @@ TEST(StringComparisonAdaptor, CanBeCopyConstructedWithAdaptor) TEST(StringComparisonAdaptor, CanBeMoveConstructedWithAdaptor) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that moving an adaptor transfers its string-like content to the destination."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -195,7 +195,7 @@ TEST(StringComparisonAdaptor, CanBeMoveConstructedWithAdaptor) TEST(StringComparisonAdaptorWithString, CanBeMoveConstructed) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that moving a string into the adaptor preserves the original content."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -206,7 +206,7 @@ TEST(StringComparisonAdaptorWithString, CanBeMoveConstructed) TEST(StringComparisonAdaptorWithString, CanBeMoveAssigned) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that move assignment from a string replaces the adaptor content."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -218,7 +218,7 @@ TEST(StringComparisonAdaptorWithString, CanBeMoveAssigned) TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStringAndStringView) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that equal string and string-view content compares equal through the adaptor."); RecordProperty("TestType", "requirements-based"); @@ -232,7 +232,7 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStr TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStringAndCString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that adaptor content compares equal with an equivalent C string."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -244,7 +244,7 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStr TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStringViewAndString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that equal string-view and string content compares equal through the adaptor."); RecordProperty("TestType", "requirements-based"); @@ -258,7 +258,7 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStr TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStringViewAndCString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that string-view adaptor content compares equal with an equivalent C string."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -271,7 +271,7 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStr TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenCStringAndString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that C-string adaptor content compares equal with an equivalent string."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -283,7 +283,7 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenCSt TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenCStringAndStringView) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that C-string adaptor content compares equal with an equivalent string view."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -296,7 +296,7 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenCSt TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringAndStringView) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that equal string and string-view content produces the same adaptor hash."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -311,7 +311,7 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringA TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringAndCString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that equal string and C-string content produces the same adaptor hash."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -324,7 +324,7 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringA TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringViewAndString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that equal string-view and string content produces the same adaptor hash."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -339,7 +339,7 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringV TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringViewAndCString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that equal string-view and C-string content produces the same adaptor hash."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -353,7 +353,7 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringV TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForCStringViewAndString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that equal C-string and string content produces the same adaptor hash."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -366,7 +366,7 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForCStringViewA TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualCStringAndStringView) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that equal C-string and string-view content produces the same adaptor hash."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); @@ -381,7 +381,7 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualCString TEST(StringComparisonAdaptorLessComparison, LessThan) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__string_like_comparison_hashing"); + RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); RecordProperty("Description", "Check that the adaptor orders string content lexicographically."); RecordProperty("TestType", "requirements-based"); RecordProperty("DerivationTechnique", "equivalence-classes"); From 8ef8ec7a8af1f4ff6502a01f0d1b3c88830a1cce Mon Sep 17 00:00:00 2001 From: Nikhil2206 Date: Thu, 17 Sep 2026 07:07:57 +0000 Subject: [PATCH 3/4] string manipulation: remove invented requirements --- .../arguments/arguments_test.cpp | 8 -- score/string_manipulation/docs/index.rst | 1 - .../docs/requirements/index.rst | 67 ----------- .../split_string_view_test.cpp | 32 ----- .../string_comparison_adaptor_test.cpp | 110 ------------------ 5 files changed, 218 deletions(-) delete mode 100644 score/string_manipulation/docs/requirements/index.rst diff --git a/score/string_manipulation/arguments/arguments_test.cpp b/score/string_manipulation/arguments/arguments_test.cpp index bb62bd66c1..3427a72a4c 100644 --- a/score/string_manipulation/arguments/arguments_test.cpp +++ b/score/string_manipulation/arguments/arguments_test.cpp @@ -17,10 +17,6 @@ TEST(GetArguments, ReturnsEmptyVectorWhenNoArguments) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__args_conv"); - RecordProperty("Description", "Check that an empty argument list produces an empty vector of string views."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "boundary-values"); constexpr int kArgc = 0; const char* argv[] = {nullptr}; auto arguments = score::string_manipulation::GetArguments(kArgc, argv); @@ -29,10 +25,6 @@ TEST(GetArguments, ReturnsEmptyVectorWhenNoArguments) TEST(GetArguments, ReturnsVectorWithProvidedArguments) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__args_conv"); - RecordProperty("Description", "Check that supplied command-line arguments are preserved in order as string views."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); constexpr int kArgc = 2; const char* argv[] = {"first", "second", nullptr}; auto arguments = score::string_manipulation::GetArguments(kArgc, argv); diff --git a/score/string_manipulation/docs/index.rst b/score/string_manipulation/docs/index.rst index f611efc893..a3750d78a4 100644 --- a/score/string_manipulation/docs/index.rst +++ b/score/string_manipulation/docs/index.rst @@ -26,7 +26,6 @@ String Manipulation .. toctree:: :hidden: - requirements/index.rst architecture/index.rst The String Manipulation component provides allocation-conscious helpers for diff --git a/score/string_manipulation/docs/requirements/index.rst b/score/string_manipulation/docs/requirements/index.rst deleted file mode 100644 index 48f15514fa..0000000000 --- a/score/string_manipulation/docs/requirements/index.rst +++ /dev/null @@ -1,67 +0,0 @@ -.. - # ******************************************************************************* - # Copyright (c) 2026 Contributors to the Eclipse Foundation - # - # See the NOTICE file(s) distributed with this work for additional - # information regarding copyright ownership. - # - # This program and the accompanying materials are made available under the - # terms of the Apache License Version 2.0 which is available at - # https://www.apache.org/licenses/LICENSE-2.0 - # - # SPDX-License-Identifier: Apache-2.0 - # ******************************************************************************* - -Requirements -############ - -.. document:: String Manipulation Requirements - :id: doc__string_manipulation_requirements - :status: draft - :version: 1 - :safety: ASIL_B - :security: YES - :realizes: wp__requirements_comp[version==1] - :tags: requirements, string_manipulation - -Functional Requirements -======================= - -.. comp_req:: Argument Conversion - :id: comp_req__string_manipulation__args_conv - :reqtype: Functional - :security: YES - :safety: ASIL_B - :derived_from: feat_req__baselibs__utils_library[version==2] - :status: valid - :version: 1 - :tags: inspected - :satisfied_by: comp__baselibs_string_manipulation[version==1] - - The String Manipulation component shall provide an operation that converts a command-line argument array into an ordered collection of null-terminated string views. - -.. comp_req:: Lazy String Splitting - :id: comp_req__string_manipulation__lazy_split - :reqtype: Functional - :security: YES - :safety: ASIL_B - :derived_from: feat_req__baselibs__utils_library[version==2] - :status: valid - :version: 1 - :tags: inspected - :satisfied_by: comp__baselibs_string_manipulation[version==1] - - The String Manipulation component shall provide a forward-iterable operation that lazily splits a string view on a delimiter, preserves empty substrings required by delimiter placement, and performs no dynamic memory allocation. - -.. comp_req:: String-Like Comparison and Hashing - :id: comp_req__string_manipulation__cmp_hash - :reqtype: Functional - :security: YES - :safety: ASIL_B - :derived_from: feat_req__baselibs__utils_library[version==2] - :status: valid - :version: 1 - :tags: inspected - :satisfied_by: comp__baselibs_string_manipulation[version==1] - - The String Manipulation component shall provide a string-like adaptor that accepts supported string representations, exposes their content as a string view, compares by content, and produces equal hashes for equal content. \ No newline at end of file diff --git a/score/string_manipulation/split_string_view_test.cpp b/score/string_manipulation/split_string_view_test.cpp index edeb3f7fda..a2a653da4b 100644 --- a/score/string_manipulation/split_string_view_test.cpp +++ b/score/string_manipulation/split_string_view_test.cpp @@ -63,30 +63,18 @@ void ExpectEqualSequences(const StringSequence& lhs, const StringSequence& rhs) TEST(StringSplitterTests, EmptyStringShallReturnEmptyRange) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); - RecordProperty("Description", "Check that splitting an empty string produces an empty range."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "boundary-values"); LazySplitStringView splitter{"", kSeperator}; EXPECT_TRUE(splitter.begin() == splitter.end()); } TEST(StringSplitterTests, NoSeperatorShallReturnOneItem) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); - RecordProperty("Description", "Check that a string without delimiters is returned as one substring view."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); StringSequence seq{"Hello World"sv}; ExpectEqualSequences(GetSplitSequence(Join(seq)), seq); } TEST(StringSplitterTests, OneSeperatorShallReturnTwoItems) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); - RecordProperty("Description", "Check that one delimiter separates the input into two substring views."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); StringSequence seq{"Hello World"sv, "Foobar"sv}; ExpectEqualSequences(GetSplitSequence(Join(seq)), seq); @@ -94,10 +82,6 @@ TEST(StringSplitterTests, OneSeperatorShallReturnTwoItems) TEST(StringSplitterTests, SeperatorAtBeginShallReturnEmptyString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); - RecordProperty("Description", "Check that a leading delimiter produces an empty first substring."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "boundary-values"); StringSequence seq{""sv, "Hello World"sv, "Foobar"sv}; ExpectEqualSequences(GetSplitSequence(Join(seq)), seq); @@ -105,10 +89,6 @@ TEST(StringSplitterTests, SeperatorAtBeginShallReturnEmptyString) TEST(StringSplitterTests, SeperatorAtEndShallBeDiscarded) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); - RecordProperty("Description", "Check that a trailing delimiter does not create an additional substring."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "boundary-values"); StringSequence seq{"Hello World"sv, "Foobar"sv}; ExpectEqualSequences(GetSplitSequence(Join(seq) + kSeperator), seq); @@ -116,28 +96,16 @@ TEST(StringSplitterTests, SeperatorAtEndShallBeDiscarded) TEST(StringSplitterTests, SeperatorOnlyStringShallReturnEmptySubstring) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); - RecordProperty("Description", "Check that an input consisting only of the delimiter yields one empty view."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "boundary-values"); ExpectEqualSequences(GetSplitSequence(std::string{"|"}), StringSequence{""sv}); } TEST(StringSplitterTests, TwoSeperatorsShallReturnTwoEmptySubstring) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); - RecordProperty("Description", "Check that two consecutive delimiters yield two empty substring views."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "boundary-values"); ExpectEqualSequences(GetSplitSequence(std::string{"||"}), StringSequence{""sv, ""sv}); } TEST(StringSplitterTests, MultipleSeperatorsInRowShallReturnEmptySubstring) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__lazy_split"); - RecordProperty("Description", "Check that repeated delimiters preserve the empty substring between them."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "boundary-values"); ExpectEqualSequences(GetSplitSequence(std::string{"Foo||Bar"}), StringSequence{"Foo"sv, ""sv, "Bar"sv}); } diff --git a/score/string_manipulation/string_comparison_adaptor_test.cpp b/score/string_manipulation/string_comparison_adaptor_test.cpp index 41faa3c61c..9674f2e901 100644 --- a/score/string_manipulation/string_comparison_adaptor_test.cpp +++ b/score/string_manipulation/string_comparison_adaptor_test.cpp @@ -66,32 +66,17 @@ TYPED_TEST_SUITE(StringComparisonAdaptorFixture, MyTypes, ); TEST(StringComparisonAdaptorHelpersFixture, CreateUnderlyingStringReturnCorrectValues) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that the test helper creates equivalent string and string-view content."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); EXPECT_THAT(CreateUnderlyingString("test_string"), "test_string"); EXPECT_THAT(CreateUnderlyingString("test_string").data(), StrEq("test_string")); } TYPED_TEST(StringComparisonAdaptorFixture, CanBeConvertedImplicitly) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - this->RecordProperty("Description", - "Check that each supported string representation converts implicitly to the adaptor."); - this->RecordProperty("TestType", "interface-test"); - this->RecordProperty("DerivationTechnique", "equivalence-classes"); EXPECT_THAT((std::is_convertible::value), IsTrue()); } TYPED_TEST(StringComparisonAdaptorFixture, CanBeCopyConstructed) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - this->RecordProperty( - "Description", - "Check that constructing an adaptor from a supported string representation preserves its content."); - this->RecordProperty("TestType", "requirements-based"); - this->RecordProperty("DerivationTechnique", "equivalence-classes"); const auto underlying_string = CreateUnderlyingString("b"); StringComparisonAdaptor adaptor{underlying_string}; EXPECT_THAT(adaptor, Eq(underlying_string)); @@ -99,11 +84,6 @@ TYPED_TEST(StringComparisonAdaptorFixture, CanBeCopyConstructed) TYPED_TEST(StringComparisonAdaptorFixture, CanBeCopyAssigned) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - this->RecordProperty("Description", - "Check that assigning a supported string representation updates the adaptor content."); - this->RecordProperty("TestType", "requirements-based"); - this->RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor{"a"}; const auto underlying_string = CreateUnderlyingString("b"); adaptor = underlying_string; @@ -112,11 +92,6 @@ TYPED_TEST(StringComparisonAdaptorFixture, CanBeCopyAssigned) TYPED_TEST(StringComparisonAdaptorFixture, GetStringViewReturnsValidStringView) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - this->RecordProperty("Description", - "Check that the adaptor exposes its stored content as the expected string view."); - this->RecordProperty("TestType", "interface-test"); - this->RecordProperty("DerivationTechnique", "equivalence-classes"); const auto underlying_string = CreateUnderlyingString("a"); StringComparisonAdaptor adaptor{underlying_string}; @@ -125,10 +100,6 @@ TYPED_TEST(StringComparisonAdaptorFixture, GetStringViewReturnsValidStringView) TYPED_TEST(StringComparisonAdaptorFixture, ComparisonReturnsTrueForSameContent) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - this->RecordProperty("Description", "Check that an adaptor compares equal to a string with identical content."); - this->RecordProperty("TestType", "requirements-based"); - this->RecordProperty("DerivationTechnique", "equivalence-classes"); const auto underlying_string = CreateUnderlyingString("a"); StringComparisonAdaptor adaptor{underlying_string}; EXPECT_THAT(adaptor, Eq("a")); @@ -136,10 +107,6 @@ TYPED_TEST(StringComparisonAdaptorFixture, ComparisonReturnsTrueForSameContent) TYPED_TEST(StringComparisonAdaptorFixture, ComparisonReturnsFalseForDifferentContent) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - this->RecordProperty("Description", "Check that adaptors with different content compare unequal."); - this->RecordProperty("TestType", "requirements-based"); - this->RecordProperty("DerivationTechnique", "equivalence-classes"); const auto underlying_string_1 = CreateUnderlyingString("a"); StringComparisonAdaptor adaptor{underlying_string_1}; @@ -149,12 +116,6 @@ TYPED_TEST(StringComparisonAdaptorFixture, ComparisonReturnsFalseForDifferentCon TYPED_TEST(StringComparisonAdaptorFixture, HashIsSameForTwoEqualAdaptors) { - this->RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - this->RecordProperty( - "Description", - "Check that equal adaptor content produces equal hash values for both supported representations."); - this->RecordProperty("TestType", "requirements-based"); - this->RecordProperty("DerivationTechnique", "equivalence-classes"); const auto underlying_string_1 = CreateUnderlyingString("a"); StringComparisonAdaptor adaptor1{underlying_string_1}; @@ -165,11 +126,6 @@ TYPED_TEST(StringComparisonAdaptorFixture, HashIsSameForTwoEqualAdaptors) TEST(StringComparisonAdaptor, CanBeCopyConstructedWithAdaptor) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", - "Check that copying an adaptor preserves its content and keeps the instances independent."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor1{"a"}; StringComparisonAdaptor adaptor2{adaptor1}; @@ -183,10 +139,6 @@ TEST(StringComparisonAdaptor, CanBeCopyConstructedWithAdaptor) TEST(StringComparisonAdaptor, CanBeMoveConstructedWithAdaptor) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that moving an adaptor transfers its string-like content to the destination."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor1{"a"}; StringComparisonAdaptor adaptor2{std::move(adaptor1)}; @@ -195,10 +147,6 @@ TEST(StringComparisonAdaptor, CanBeMoveConstructedWithAdaptor) TEST(StringComparisonAdaptorWithString, CanBeMoveConstructed) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that moving a string into the adaptor preserves the original content."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str{"b"}; StringComparisonAdaptor adaptor{std::move(str)}; EXPECT_THAT(adaptor, Eq(std::string{"b"})); @@ -206,10 +154,6 @@ TEST(StringComparisonAdaptorWithString, CanBeMoveConstructed) TEST(StringComparisonAdaptorWithString, CanBeMoveAssigned) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that move assignment from a string replaces the adaptor content."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor{"a"}; std::string str{"b"}; adaptor = std::move(str); @@ -218,11 +162,6 @@ TEST(StringComparisonAdaptorWithString, CanBeMoveAssigned) TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStringAndStringView) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", - "Check that equal string and string-view content compares equal through the adaptor."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str{"a"}; StringComparisonAdaptor adaptor{str}; @@ -232,10 +171,6 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStr TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStringAndCString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that adaptor content compares equal with an equivalent C string."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str{"a"}; StringComparisonAdaptor adaptor{str}; @@ -244,11 +179,6 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStr TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStringViewAndString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", - "Check that equal string-view and string content compares equal through the adaptor."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str{"a"}; std::string_view str_view{str}; StringComparisonAdaptor adaptor{str_view}; @@ -258,10 +188,6 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStr TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStringViewAndCString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that string-view adaptor content compares equal with an equivalent C string."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str{"a"}; std::string_view str_view{str}; StringComparisonAdaptor adaptor{str_view}; @@ -271,10 +197,6 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenStr TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenCStringAndString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that C-string adaptor content compares equal with an equivalent string."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor{"a"}; std::string str{"a"}; @@ -283,10 +205,6 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenCSt TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenCStringAndStringView) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that C-string adaptor content compares equal with an equivalent string view."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor{"a"}; std::string str{"a"}; @@ -296,10 +214,6 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, ComparisonWorksBetweenCSt TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringAndStringView) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that equal string and string-view content produces the same adaptor hash."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str1{"a"}; StringComparisonAdaptor adaptor1{str1}; @@ -311,10 +225,6 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringA TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringAndCString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that equal string and C-string content produces the same adaptor hash."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str1{"a"}; StringComparisonAdaptor adaptor1{str1}; @@ -324,10 +234,6 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringA TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringViewAndString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that equal string-view and string content produces the same adaptor hash."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str1{"a"}; std::string_view str_view1{str1}; StringComparisonAdaptor adaptor1{str_view1}; @@ -339,10 +245,6 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringV TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringViewAndCString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that equal string-view and C-string content produces the same adaptor hash."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); std::string str1{"a"}; std::string_view str_view1{str1}; StringComparisonAdaptor adaptor1{str_view1}; @@ -353,10 +255,6 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualStringV TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForCStringViewAndString) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that equal C-string and string content produces the same adaptor hash."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor1{"a"}; std::string str{"a"}; @@ -366,10 +264,6 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForCStringViewA TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualCStringAndStringView) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that equal C-string and string-view content produces the same adaptor hash."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor1{"a"}; std::string string{"a"}; @@ -381,10 +275,6 @@ TEST(StringComparisonAdaptorWithDifferentContentTypes, HashIsSameForEqualCString TEST(StringComparisonAdaptorLessComparison, LessThan) { - RecordProperty("PartiallyVerifies", "comp_req__string_manipulation__cmp_hash"); - RecordProperty("Description", "Check that the adaptor orders string content lexicographically."); - RecordProperty("TestType", "requirements-based"); - RecordProperty("DerivationTechnique", "equivalence-classes"); StringComparisonAdaptor adaptor1{"ab"}; StringComparisonAdaptor adaptor2{"ac"}; EXPECT_EQ(adaptor1 < adaptor2, true); From e61a6e3f108dcc96692064249ab54dfb1e41a544 Mon Sep 17 00:00:00 2001 From: Nikhil2206 Date: Thu, 17 Sep 2026 07:18:48 +0000 Subject: [PATCH 4/4] string manipulation: remove unsupported traceability docs --- BUILD | 4 --- docs/baselibs/components/index.rst | 2 -- score/string_manipulation/BUILD | 7 ---- .../docs/architecture/index.rst | 34 ------------------- score/string_manipulation/docs/index.rst | 33 ------------------ 5 files changed, 80 deletions(-) delete mode 100644 score/string_manipulation/docs/architecture/index.rst delete mode 100644 score/string_manipulation/docs/index.rst diff --git a/BUILD b/BUILD index 260a219123..ba3b540541 100644 --- a/BUILD +++ b/BUILD @@ -87,10 +87,6 @@ docs( "bundle": "//score/result:docs", "mount_at": "baselibs/components/result", }, - { - "bundle": "//score/string_manipulation:docs", - "mount_at": "baselibs/components/string_manipulation", - }, { "bundle": "//score/static_reflection_with_serialization:docs", "mount_at": "baselibs/components/static_reflection_with_serialization", diff --git a/docs/baselibs/components/index.rst b/docs/baselibs/components/index.rst index 78a5ca924c..75aac0dcd8 100644 --- a/docs/baselibs/components/index.rst +++ b/docs/baselibs/components/index.rst @@ -55,5 +55,3 @@ Overview - *mw::log*: Logging frontend. - :need:`doc__utils`: Provides a collection of small, reusable utilities that do not fit into the other base libraries. -- :need:`doc__string_manipulation`: Provides allocation-conscious helpers for command-line arguments, - lazy string-view splitting, and string-like comparison and hashing. diff --git a/score/string_manipulation/BUILD b/score/string_manipulation/BUILD index 0b21cce902..79670c946e 100644 --- a/score/string_manipulation/BUILD +++ b/score/string_manipulation/BUILD @@ -14,7 +14,6 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") load("@score_baselibs//score/language/safecpp:toolchain_features.bzl", "COMPILER_WARNING_FEATURES") load("@score_baselibs//score/quality/clang_tidy:extra_checks.bzl", "clang_tidy_extra_checks") -load("@score_docs_as_code//:docs.bzl", "docs_bundle") clang_tidy_extra_checks( name = "clang_tidy_extra_checks", @@ -107,9 +106,3 @@ cc_test( "@googletest//:gtest_main", ], ) - -docs_bundle( - name = "docs", - source_dir = "docs", - visibility = ["//visibility:public"], -) diff --git a/score/string_manipulation/docs/architecture/index.rst b/score/string_manipulation/docs/architecture/index.rst deleted file mode 100644 index 2041ce7bd1..0000000000 --- a/score/string_manipulation/docs/architecture/index.rst +++ /dev/null @@ -1,34 +0,0 @@ -.. - # ******************************************************************************* - # Copyright (c) 2026 Contributors to the Eclipse Foundation - # - # See the NOTICE file(s) distributed with this work for additional - # information regarding copyright ownership. - # - # This program and the accompanying materials are made available under the - # terms of the Apache License Version 2.0 which is available at - # https://www.apache.org/licenses/LICENSE-2.0 - # - # SPDX-License-Identifier: Apache-2.0 - # ******************************************************************************* - -String Manipulation Architecture -################################# - -.. document:: String Manipulation Architecture - :id: doc__string_manipulation_architecture - :status: draft - :version: 1 - :safety: ASIL_B - :security: YES - :realizes: wp__component_arch[version==1] - -.. comp:: String Manipulation - :id: comp__baselibs_string_manipulation - :security: YES - :safety: ASIL_B - :status: valid - :version: 1 - :belongs_to: feat__baselibs[version==1] - - The String Manipulation component contains helpers for command-line arguments, string-view splitting, and string-like comparisons. \ No newline at end of file diff --git a/score/string_manipulation/docs/index.rst b/score/string_manipulation/docs/index.rst deleted file mode 100644 index a3750d78a4..0000000000 --- a/score/string_manipulation/docs/index.rst +++ /dev/null @@ -1,33 +0,0 @@ -.. - # ******************************************************************************* - # Copyright (c) 2026 Contributors to the Eclipse Foundation - # - # See the NOTICE file(s) distributed with this work for additional - # information regarding copyright ownership. - # - # This program and the accompanying materials are made available under the - # terms of the Apache License Version 2.0 which is available at - # https://www.apache.org/licenses/LICENSE-2.0 - # - # SPDX-License-Identifier: Apache-2.0 - # ******************************************************************************* - -String Manipulation -################### - -.. document:: String Manipulation - :id: doc__string_manipulation - :status: draft - :version: 1 - :safety: ASIL_B - :security: YES - :realizes: wp__cmpt_request[version==1] - -.. toctree:: - :hidden: - - architecture/index.rst - -The String Manipulation component provides allocation-conscious helpers for -handling command-line arguments, splitting string views, and comparing -string-like values. \ No newline at end of file