Skip to content

Commit 2e79385

Browse files
fix: remove comparision to true from asserts
1 parent ee40cbc commit 2e79385

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

data_structures/stack_using_array.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ static void test() {
108108
data_structures::Stack<int> stack(5);
109109

110110
// Test empty and full operations
111-
assert(stack.empty() == true);
112-
assert(stack.full() == false);
111+
assert(stack.empty());
112+
assert(!stack.full());
113113

114114
// Test pushing elements and checking topmost
115115
stack.push(10);
@@ -121,7 +121,7 @@ static void test() {
121121
stack.push(30);
122122
stack.push(40);
123123
stack.push(50);
124-
assert(stack.full() == true);
124+
assert(stack.full());
125125

126126
// Test stack overflow
127127
try {
@@ -142,8 +142,8 @@ static void test() {
142142
assert(stack.pop() == 20);
143143
assert(stack.pop() == 10);
144144

145-
assert(stack.empty() == true);
146-
assert(stack.full() == false);
145+
assert(stack.empty());
146+
assert(!stack.full());
147147

148148
// Test stack underflow
149149
try {

0 commit comments

Comments
 (0)