[libcxx-commits] [pstl] [pstl] Fix typos in MemoryChecker assertion messages (PR #85624)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Mar 18 03:21:30 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 92122b0b4b514ea6c081e428f47ef1bf9d4f0f17 2ad23ff50f5787053fe6c3a1178deeea65f7f1f8 -- pstl/test/support/utils.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/pstl/test/support/utils.h b/pstl/test/support/utils.h
index 3f3a511acc..9c67a94bb4 100644
--- a/pstl/test/support/utils.h
+++ b/pstl/test/support/utils.h
@@ -252,7 +252,8 @@ struct MemoryChecker {
MemoryChecker(MemoryChecker&& other) : _value(other.value()) {
// check for EXPECT_TRUE(state() != alive_state, ...) has not been done since
// compiler can optimize out the move ctor call that results in false positive failure
- EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker(MemoryChecker&&): attempt to construct an object from non-existing object");
+ EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker(MemoryChecker&&): attempt to "
+ "construct an object from non-existing object");
// set constructed state and increment counter for living object
inc_alive_objects();
_state = alive_state;
@@ -260,15 +261,18 @@ struct MemoryChecker {
MemoryChecker(const MemoryChecker& other) : _value(other.value()) {
// check for EXPECT_TRUE(state() != alive_state, ...) has not been done since
// compiler can optimize out the copy ctor call that results in false positive failure
- EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker(const MemoryChecker&): attempt to construct an object from non-existing object");
+ EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker(const MemoryChecker&): attempt to "
+ "construct an object from non-existing object");
// set constructed state and increment counter for living object
inc_alive_objects();
_state = alive_state;
}
MemoryChecker& operator=(MemoryChecker&& other) {
// check if we do not assign over uninitialized memory
- EXPECT_TRUE(state() == alive_state, "wrong effect from MemoryChecker::operator=(MemoryChecker&& other): attempt to assign to non-existing object");
- EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker::operator=(MemoryChecker&& other): attempt to assign from non-existing object");
+ EXPECT_TRUE(state() == alive_state, "wrong effect from MemoryChecker::operator=(MemoryChecker&& other): "
+ "attempt to assign to non-existing object");
+ EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker::operator=(MemoryChecker&& other): "
+ "attempt to assign from non-existing object");
// just assign new value, counter is the same, state is the same
_value = other.value();
@@ -276,8 +280,10 @@ struct MemoryChecker {
}
MemoryChecker& operator=(const MemoryChecker& other) {
// check if we do not assign over uninitialized memory
- EXPECT_TRUE(state() == alive_state, "wrong effect from MemoryChecker::operator=(const MemoryChecker& other): attempt to assign to non-existing object");
- EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker::operator=(const MemoryChecker& other): attempt to assign from non-existing object");
+ EXPECT_TRUE(state() == alive_state, "wrong effect from MemoryChecker::operator=(const MemoryChecker& other): "
+ "attempt to assign to non-existing object");
+ EXPECT_TRUE(other.state() == alive_state, "wrong effect from MemoryChecker::operator=(const MemoryChecker& "
+ "other): attempt to assign from non-existing object");
// just assign new value, counter is the same, state is the same
_value = other.value();
@@ -285,7 +291,8 @@ struct MemoryChecker {
}
~MemoryChecker() {
// check if we do not double destruct the object
- EXPECT_TRUE(state() == alive_state, "wrong effect from ~MemoryChecker(): attempt to destroy non-existing object");
+ EXPECT_TRUE(state() == alive_state,
+ "wrong effect from ~MemoryChecker(): attempt to destroy non-existing object");
// set destructed state and decrement counter for living object
static_cast<volatile std::int64_t&>(_state) = dead_state;
dec_alive_objects();
``````````
</details>
https://github.com/llvm/llvm-project/pull/85624
More information about the libcxx-commits
mailing list