Rollback clang's _NonNull attribute, too many warnings in older compilers. Replaced with BOOST_ASSERT null checks and added some corner cases to the test-suite.

This commit is contained in:
Ion Gaztañaga
2026-01-23 00:18:46 +01:00
parent 60d933fc09
commit 4f449051f0
4 changed files with 192 additions and 131 deletions

View File

@@ -1291,6 +1291,9 @@ void test_insert_initializer_list()
s.insert(s.end(), {'d', 'e', 'f'});
BOOST_TEST(s == "abcdef");
s.insert(s.end(), {});
BOOST_TEST(s == "abcdef");
#endif
}
@@ -1412,6 +1415,9 @@ void test_append_initializer_list()
s.append({',', ' ', 'W', 'o', 'r', 'l', 'd', '!'});
BOOST_TEST(s == "Hello, World!");
s.append({});
BOOST_TEST(s == "Hello, World!");
#endif
}
@@ -1435,6 +1441,8 @@ void test_operator_plus_equals()
// += initializer_list
s += {'!', '!'};
BOOST_TEST(s == "Hello, World!!!");
s += {};
BOOST_TEST(s == "Hello, World!!!");
#endif
}
@@ -1587,6 +1595,8 @@ void test_replace_iterator()
s = "Hello, World!";
s.replace(s.begin() + 7, s.begin() + 12, {'S', 'u', 'n'});
BOOST_TEST(s == "Hello, Sun!");
s.replace(s.begin() + 5, s.begin() + 10, {});
BOOST_TEST(s == "Hello!");
#endif
}