mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-08 21:16:26 +08:00
[fix/docs]: remove memory leak in queue (#2417)
* fix: remove memory leak in queue
* updating DIRECTORY.md
* clang-format and clang-tidy fixes for effd74c9
* style: simplify logic while using reserve
* style: use value_type as return type in front
* style: use proper error message
* style: use pre-increment and pre-decrement
* docs: use doxygen syntax
* docs: improve wording
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
@@ -157,7 +157,7 @@ void testAssign() {
|
||||
assert(stackB.toVector() == otherExpectedDataB);
|
||||
}
|
||||
|
||||
void testTopThrowsAnvalidArgumentWhenStackEmpty() {
|
||||
void testTopThrowsAnInvalidArgumentWhenStackEmpty() {
|
||||
const stack<long double> curStack;
|
||||
bool wasException = false;
|
||||
try {
|
||||
@@ -168,7 +168,7 @@ void testTopThrowsAnvalidArgumentWhenStackEmpty() {
|
||||
assert(wasException);
|
||||
}
|
||||
|
||||
void testPopThrowsAnvalidArgumentWhenStackEmpty() {
|
||||
void testPopThrowsAnInvalidArgumentWhenStackEmpty() {
|
||||
stack<bool> curStack;
|
||||
bool wasException = false;
|
||||
try {
|
||||
@@ -195,8 +195,8 @@ int main() {
|
||||
|
||||
testAssign();
|
||||
|
||||
testTopThrowsAnvalidArgumentWhenStackEmpty();
|
||||
testPopThrowsAnvalidArgumentWhenStackEmpty();
|
||||
testTopThrowsAnInvalidArgumentWhenStackEmpty();
|
||||
testPopThrowsAnInvalidArgumentWhenStackEmpty();
|
||||
|
||||
std::cout << "All tests pass!\n";
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user