mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-23 22:09:19 +08:00

Fix a few typos: - implemention -> implementation - convertion(s) -> conversion(s) - backlashes -> backslashes - signoring -> ignoring - (un)ambigious -> (un)ambiguous - occured -> occurred - hidding -> hiding - temporarilly -> temporarily - immediatelly -> immediately - sillyness -> silliness - similiar -> similar - porkuser -> pokeuser - thats -> that - alway -> always - supercede -> supersede - accomodate -> accommodate - aquire -> acquire - priveleged -> privileged - priviliged -> privileged - priviledges -> privileges - privilige -> privilege - recieve -> receive - (p)refered -> (p)referred - succesfully -> successfully - successfuly -> successfully - responsability -> responsibility - wether -> whether - wich -> which - disasbleable -> disableable - descriminant -> discriminant - construcstor -> constructor - underlaying -> underlying - underyling -> underlying - structureal -> structural - appearences -> appearances - terciarily -> tertiarily - resgisters -> registers - reacheable -> reachable - likelyhood -> likelihood - intepreter -> interpreter - disassemly -> disassembly - covnersion -> conversion - conviently -> conveniently - atttribute -> attribute - struction -> struct - resonable -> reasonable - popupated -> populated - namespaxe -> namespace - intialize -> initialize - identifer(s) -> identifier(s) - expection -> exception - exectuted -> executed - dungerous -> dangerous - dissapear -> disappear - completly -> completely - (inter)changable -> (inter)changeable - beakpoint -> breakpoint - automativ -> automatic - alocating -> allocating - agressive -> aggressive - writting -> writing - reguires -> requires - registed -> registered - recuding -> reducing - opeartor -> operator - ommitted -> omitted - modifing -> modifying - intances -> instances - imbedded -> embedded - gdbaarch -> gdbarch - exection -> execution - direcive -> directive - demanged -> demangled - decidely -> decidedly - argments -> arguments - agrument -> argument - amespace -> namespace - targtet -> target - supress(ed) -> suppress(ed) - startum -> stratum - squence -> sequence - prompty -> prompt - overlow -> overflow - memember -> member - languge -> language - geneate -> generate - funcion -> function - exising -> existing - dinking -> syncing - destroh -> destroy - clenaed -> cleaned - changep -> changedp (name of variable) - arround -> around - aproach -> approach - whould -> would - symobl -> symbol - recuse -> recurse - outter -> outer - freeds -> frees - contex -> context Tested on x86_64-linux. Reviewed-By: Tom Tromey <tom@tromey.com>
77 lines
2.2 KiB
C
77 lines
2.2 KiB
C
/* Self tests for vector utility routines for GDB, the GNU debugger.
|
|
|
|
Copyright (C) 2019-2023 Free Software Foundation, Inc.
|
|
|
|
This file is part of GDB.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#include "gdbsupport/common-defs.h"
|
|
#include "gdbsupport/selftest.h"
|
|
|
|
#include "gdbsupport/gdb_vecs.h"
|
|
|
|
namespace selftests {
|
|
namespace vector_utils_tests {
|
|
|
|
static void
|
|
unordered_remove_tests ()
|
|
{
|
|
/* Create vector with a single object in, and then remove that object.
|
|
This test was added after a bug was discovered where unordered_remove
|
|
would cause a self move assign. If the C++ standard library is
|
|
compiled in debug mode (by passing -D_GLIBCXX_DEBUG=1) and the
|
|
operator= is removed from struct obj this test used to fail with an
|
|
error from the C++ standard library. */
|
|
struct obj
|
|
{
|
|
std::vector<void *> var;
|
|
|
|
obj() = default;
|
|
|
|
/* gcc complains if we provide an assignment operator but no copy
|
|
constructor, so provide one even if don't really care for this test. */
|
|
obj(const obj &other)
|
|
{
|
|
this->var = other.var;
|
|
}
|
|
|
|
obj &operator= (const obj &other)
|
|
{
|
|
if (this == &other)
|
|
error (_("detected self move assign"));
|
|
this->var = other.var;
|
|
return *this;
|
|
}
|
|
};
|
|
|
|
std::vector<obj> v;
|
|
v.emplace_back ();
|
|
auto it = v.end () - 1;
|
|
unordered_remove (v, it);
|
|
SELF_CHECK (v.empty ());
|
|
}
|
|
|
|
} /* namespace vector_utils_tests */
|
|
} /* namespace selftests */
|
|
|
|
void _initialize_vec_utils_selftests ();
|
|
void
|
|
_initialize_vec_utils_selftests ()
|
|
{
|
|
selftests::register_test
|
|
("unordered_remove",
|
|
selftests::vector_utils_tests::unordered_remove_tests);
|
|
}
|