private:
static void SanityTest() {
- CHECKPOINT("sanity test");
+ // sanity test
Container C = {1, 1, 1, 1};
::DoNotOptimize(&C);
}
static void RemoveFirstElem() {
// See llvm.org/PR35564
- CHECKPOINT("remove(<first-elem>)");
+ // remove(<first-elem>)
{
Container C = makeContainer(1);
auto FirstVal = *(C.begin());
static void SpliceFirstElem() {
// See llvm.org/PR35564
- CHECKPOINT("splice(<first-elem>)");
+ // splice(<first-elem>)
{
Container C = makeContainer(1);
Container C2;
}
static void SpliceSameContainer() {
- CHECKPOINT("splice(<same-container>)");
+ // splice(<same-container>)
Container C = {1, 1};
C.splice(C.end(), C, C.begin());
}
static void SpliceFirstElemAfter() {
// See llvm.org/PR35564
- CHECKPOINT("splice(<first-elem>)");
+ // splice(<first-elem>)
{
Container C = makeContainer(1);
Container C2;
}
static void AssignInvalidates() {
- CHECKPOINT("assign(Size, Value)");
+ // assign(Size, Value)
Container C(allocator_type{});
iterator it1, it2, it3;
auto reset = [&]() {
C.assign(2, makeValueType(4));
check();
reset();
- CHECKPOINT("assign(Iter, Iter)");
+ // assign(Iter, Iter)
std::vector<value_type> V = {
makeValueType(1),
makeValueType(2),
C.assign(V.begin(), V.end());
check();
reset();
- CHECKPOINT("assign(initializer_list)");
+ // assign(initializer_list)
C.assign({makeValueType(1), makeValueType(2), makeValueType(3)});
check();
}
static void BackOnEmptyContainer() {
- CHECKPOINT("testing back on empty");
+ // testing back on empty
Container C = makeContainer(1);
Container const& CC = C;
(void)C.back();
}
static void FrontOnEmptyContainer() {
- CHECKPOINT("testing front on empty");
+ // testing front on empty
Container C = makeContainer(1);
Container const& CC = C;
(void)C.front();
}
static void EraseIterIter() {
- CHECKPOINT("testing erase iter iter invalidation");
+ // testing erase iter iter invalidation
Container C1 = makeContainer(3);
iterator it1 = C1.begin();
iterator it1_next = ++C1.begin();
}
static void PopBack() {
- CHECKPOINT("testing pop_back() invalidation");
+ // testing pop_back() invalidation
Container C1 = makeContainer(2);
iterator it1 = C1.end();
--it1;
}
static void PopFront() {
- CHECKPOINT("testing pop_front() invalidation");
+ // testing pop_front() invalidation
Container C1 = makeContainer(2);
iterator it1 = C1.begin();
C1.pop_front();
}
static void InsertIterValue() {
- CHECKPOINT("testing insert(iter, value)");
+ // testing insert(iter, value)
Container C1 = makeContainer(2);
iterator it1 = C1.begin();
iterator it1_next = it1;
}
static void EmplaceIterValue() {
- CHECKPOINT("testing emplace(iter, value)");
+ // testing emplace(iter, value)
Container C1 = makeContainer(2);
iterator it1 = C1.begin();
iterator it1_next = it1;
}
static void InsertIterSizeValue() {
- CHECKPOINT("testing insert(iter, size, value)");
+ // testing insert(iter, size, value)
Container C1 = makeContainer(2);
iterator it1 = C1.begin();
iterator it1_next = it1;
}
static void InsertIterIterIter() {
- CHECKPOINT("testing insert(iter, iter, iter)");
+ // testing insert(iter, iter, iter)
Container C1 = makeContainer(2);
iterator it1 = C1.begin();
iterator it1_next = it1;
private:
static void BackOnEmptyContainer(int N) {
- CHECKPOINT("testing back on empty");
+ // testing back on empty
Container C = makeContainer(N);
Container const& CC = C;
iterator it = --C.end();
}
static void FrontOnEmptyContainer(int N) {
- CHECKPOINT("testing front on empty");
+ // testing front on empty
Container C = makeContainer(N);
Container const& CC = C;
(void)C.front();
}
static void PopBack(int N) {
- CHECKPOINT("testing pop_back() invalidation");
+ // testing pop_back() invalidation
Container C1 = makeContainer(N);
iterator it1 = C1.end();
--it1;
#include "test_macros.h"
#include "count_new.h"
#include "container_test_types.h"
-#include "assert_checkpoint.h"
template <class Container>
ConstructController* cc = getConstructController();
cc->reset();
{
- CHECKPOINT("Testing C::insert(const value_type&)");
+ // Testing C::insert(const value_type&)
Container c;
const ValueTp v(42, 1);
cc->expect<const ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::insert(value_type&)");
+ // Testing C::insert(value_type&)
Container c;
ValueTp v(42, 1);
cc->expect<const ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::insert(value_type&&)");
+ // Testing C::insert(value_type&&)
Container c;
ValueTp v(42, 1);
cc->expect<ValueTp&&>();
}
}
{
- CHECKPOINT("Testing C::insert(const value_type&&)");
+ // Testing C::insert(const value_type&&)
Container c;
const ValueTp v(42, 1);
cc->expect<const ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::insert({key, value})");
+ // Testing C::insert({key, value})
Container c;
cc->expect<ValueTp&&>();
assert(c.insert({42, 1}).second);
}
}
{
- CHECKPOINT("Testing C::insert(std::initializer_list<ValueTp>)");
+ // Testing C::insert(std::initializer_list<ValueTp>)
Container c;
std::initializer_list<ValueTp> il = { ValueTp(1, 1), ValueTp(2, 1) };
cc->expect<ValueTp const&>(2);
}
}
{
- CHECKPOINT("Testing C::insert(Iter, Iter) for *Iter = value_type const&");
+ // Testing C::insert(Iter, Iter) for *Iter = value_type const&
Container c;
const ValueTp ValueList[] = { ValueTp(1, 1), ValueTp(2, 1), ValueTp(3, 1) };
cc->expect<ValueTp const&>(3);
}
}
{
- CHECKPOINT("Testing C::insert(Iter, Iter) for *Iter = value_type&&");
+ // Testing C::insert(Iter, Iter) for *Iter = value_type&&
Container c;
ValueTp ValueList[] = { ValueTp(1, 1), ValueTp(2, 1) , ValueTp(3, 1) };
cc->expect<ValueTp&&>(3);
}
}
{
- CHECKPOINT("Testing C::insert(Iter, Iter) for *Iter = value_type&");
+ // Testing C::insert(Iter, Iter) for *Iter = value_type&
Container c;
ValueTp ValueList[] = { ValueTp(1, 1), ValueTp(2, 1) , ValueTp(3, 1) };
cc->expect<ValueTp const&>(3);
ConstructController* cc = getConstructController();
cc->reset();
{
- CHECKPOINT("Testing C::insert(p, const value_type&)");
+ // Testing C::insert(p, const value_type&)
Container c;
const ValueTp v(42, 1);
cc->expect<const ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::insert(p, value_type&)");
+ // Testing C::insert(p, value_type&)
Container c;
ValueTp v(42, 1);
cc->expect<ValueTp const&>();
}
}
{
- CHECKPOINT("Testing C::insert(p, value_type&&)");
+ // Testing C::insert(p, value_type&&)
Container c;
ValueTp v(42, 1);
cc->expect<ValueTp&&>();
}
}
{
- CHECKPOINT("Testing C::insert(p, {key, value})");
+ // Testing C::insert(p, {key, value})
Container c;
cc->expect<ValueTp&&>();
It ret = c.insert(c.end(), {42, 1});
}
}
{
- CHECKPOINT("Testing C::insert(p, const value_type&&)");
+ // Testing C::insert(p, const value_type&&)
Container c;
const ValueTp v(42, 1);
cc->expect<const ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::insert(p, pair<Key, Mapped> const&)");
+ // Testing C::insert(p, pair<Key, Mapped> const&)
Container c;
const NonConstKeyPair v(42, 1);
cc->expect<const NonConstKeyPair&>();
}
}
{
- CHECKPOINT("Testing C::insert(p, pair<Key, Mapped>&&)");
+ // Testing C::insert(p, pair<Key, Mapped>&&)
Container c;
NonConstKeyPair v(42, 1);
cc->expect<NonConstKeyPair&&>();
ConstructController* cc = getConstructController();
cc->reset();
{
- CHECKPOINT("Testing C::emplace(const value_type&)");
+ // Testing C::emplace(const value_type&)
Container c;
const ValueTp v(42, 1);
cc->expect<const ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::emplace(value_type&)");
+ // Testing C::emplace(value_type&)
Container c;
ValueTp v(42, 1);
cc->expect<ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::emplace(value_type&&)");
+ // Testing C::emplace(value_type&&)
Container c;
ValueTp v(42, 1);
cc->expect<ValueTp&&>();
}
}
{
- CHECKPOINT("Testing C::emplace(const value_type&&)");
+ // Testing C::emplace(const value_type&&)
Container c;
const ValueTp v(42, 1);
cc->expect<const ValueTp&&>();
}
}
{
- CHECKPOINT("Testing C::emplace(pair<Key, Mapped> const&)");
+ // Testing C::emplace(pair<Key, Mapped> const&)
Container c;
const NonConstKeyPair v(42, 1);
cc->expect<const NonConstKeyPair&>();
}
}
{
- CHECKPOINT("Testing C::emplace(pair<Key, Mapped> &&)");
+ // Testing C::emplace(pair<Key, Mapped> &&)
Container c;
NonConstKeyPair v(42, 1);
cc->expect<NonConstKeyPair&&>();
}
}
{
- CHECKPOINT("Testing C::emplace(const Key&, ConvertibleToMapped&&)");
+ // Testing C::emplace(const Key&, ConvertibleToMapped&&)
Container c;
const Key k(42);
cc->expect<Key const&, int&&>();
}
}
{
- CHECKPOINT("Testing C::emplace(Key&, Mapped&)");
+ // Testing C::emplace(Key&, Mapped&)
Container c;
Key k(42);
Mapped m(1);
}
}
{
- CHECKPOINT("Testing C::emplace(Key&&, Mapped&&)");
+ // Testing C::emplace(Key&&, Mapped&&)
Container c;
Key k(42);
Mapped m(1);
}
}
{
- CHECKPOINT("Testing C::emplace(ConvertibleToKey&&, ConvertibleToMapped&&)");
+ // Testing C::emplace(ConvertibleToKey&&, ConvertibleToMapped&&)
Container c;
cc->expect<int&&, int&&>();
assert(c.emplace(42, 1).second);
ConstructController* cc = getConstructController();
cc->reset();
{
- CHECKPOINT("Testing C::emplace_hint(p, const value_type&)");
+ // Testing C::emplace_hint(p, const value_type&)
Container c;
const ValueTp v(42, 1);
cc->expect<const ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::emplace_hint(p, value_type&)");
+ // Testing C::emplace_hint(p, value_type&)
Container c;
ValueTp v(42, 1);
cc->expect<ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::emplace_hint(p, value_type&&)");
+ // Testing C::emplace_hint(p, value_type&&)
Container c;
ValueTp v(42, 1);
cc->expect<ValueTp&&>();
}
}
{
- CHECKPOINT("Testing C::emplace_hint(p, const value_type&&)");
+ // Testing C::emplace_hint(p, const value_type&&)
Container c;
const ValueTp v(42, 1);
cc->expect<const ValueTp&&>();
}
}
{
- CHECKPOINT("Testing C::emplace_hint(p, pair<Key, Mapped> const&)");
+ // Testing C::emplace_hint(p, pair<Key, Mapped> const&)
Container c;
const NonConstKeyPair v(42, 1);
cc->expect<const NonConstKeyPair&>();
}
}
{
- CHECKPOINT("Testing C::emplace_hint(p, pair<Key, Mapped>&&)");
+ // Testing C::emplace_hint(p, pair<Key, Mapped>&&)
Container c;
NonConstKeyPair v(42, 1);
cc->expect<NonConstKeyPair&&>();
}
}
{
- CHECKPOINT("Testing C::emplace_hint(p, const Key&, ConvertibleToMapped&&)");
+ // Testing C::emplace_hint(p, const Key&, ConvertibleToMapped&&)
Container c;
const Key k(42);
cc->expect<Key const&, int&&>();
}
}
{
- CHECKPOINT("Testing C::emplace_hint(p, Key&, Mapped&)");
+ // Testing C::emplace_hint(p, Key&, Mapped&)
Container c;
Key k(42);
Mapped m(1);
}
}
{
- CHECKPOINT("Testing C::emplace_hint(p, Key&&, Mapped&&)");
+ // Testing C::emplace_hint(p, Key&&, Mapped&&)
Container c;
Key k(42);
Mapped m(1);
}
}
{
- CHECKPOINT("Testing C::emplace_hint(p, ConvertibleToKey&&, ConvertibleToMapped&&)");
+ // Testing C::emplace_hint(p, ConvertibleToKey&&, ConvertibleToMapped&&)
Container c;
cc->expect<int&&, int&&>();
It ret = c.emplace_hint(c.end(), 42, 1);
ConstructController* cc = getConstructController();
cc->reset();
{
- CHECKPOINT("Testing C::insert(const value_type&)");
+ // Testing C::insert(const value_type&)
Container c;
const ValueTp v(42, 1);
cc->expect<const ValueTp&>();
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(value_type&)");
+ // Testing C::insert(value_type&)
Container c;
ValueTp v(42, 1);
cc->expect<ValueTp&>();
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(value_type&&)");
+ // Testing C::insert(value_type&&)
Container c;
ValueTp v(42, 1);
cc->expect<ValueTp&&>();
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert({key, value})");
+ // Testing C::insert({key, value})
Container c;
cc->expect<ValueTp&&>();
c.insert({42, 1});
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(std::initializer_list<ValueTp>)");
+ // Testing C::insert(std::initializer_list<ValueTp>)
Container c;
std::initializer_list<ValueTp> il = { ValueTp(1, 1), ValueTp(2, 1) };
cc->expect<ValueTp const&>(2);
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(Iter, Iter) for *Iter = value_type const&");
+ // Testing C::insert(Iter, Iter) for *Iter = value_type const&
Container c;
const ValueTp ValueList[] = { ValueTp(1, 1), ValueTp(2, 1), ValueTp(3, 1) };
cc->expect<ValueTp const&>(3);
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(Iter, Iter) for *Iter = value_type&&");
+ // Testing C::insert(Iter, Iter) for *Iter = value_type&&
Container c;
ValueTp ValueList[] = { ValueTp(1, 1), ValueTp(2, 1) , ValueTp(3, 1) };
cc->expect<ValueTp&&>(3);
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(Iter, Iter) for *Iter = value_type&");
+ // Testing C::insert(Iter, Iter) for *Iter = value_type&
Container c;
ValueTp ValueList[] = { ValueTp(1, 1), ValueTp(2, 1) , ValueTp(3, 1) };
cc->expect<ValueTp&>(3);
ConstructController* cc = getConstructController();
cc->reset();
{
- CHECKPOINT("Testing C::insert(p, const value_type&)");
+ // Testing C::insert(p, const value_type&)
Container c;
const ValueTp v(42, 1);
cc->expect<const ValueTp&>();
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(p, value_type&)");
+ // Testing C::insert(p, value_type&)
Container c;
ValueTp v(42, 1);
cc->expect<ValueTp&>();
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(p, value_type&&)");
+ // Testing C::insert(p, value_type&&)
Container c;
ValueTp v(42, 1);
cc->expect<ValueTp&&>();
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(p, {key, value})");
+ // Testing C::insert(p, {key, value})
Container c;
cc->expect<ValueTp&&>();
c.insert(c.begin(), {42, 1});
#include "test_macros.h"
#include "count_new.h"
#include "container_test_types.h"
-#include "assert_checkpoint.h"
template <class Container>
ConstructController* cc = getConstructController();
cc->reset();
{
- CHECKPOINT("Testing C::insert(const value_type&)");
+ // Testing C::insert(const value_type&)"
Container c;
const ValueTp v(42);
cc->expect<const ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::insert(value_type&)");
+ // Testing C::insert(value_type&)"
Container c;
ValueTp v(42);
cc->expect<const ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::insert(value_type&&)");
+ // Testing C::insert(value_type&&)"
Container c;
ValueTp v(42);
cc->expect<ValueTp&&>();
}
}
{
- CHECKPOINT("Testing C::insert(const value_type&&)");
+ // Testing C::insert(const value_type&&)"
Container c;
const ValueTp v(42);
cc->expect<const ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::insert(std::initializer_list<ValueTp>)");
+ // Testing C::insert(std::initializer_list<ValueTp>)"
Container c;
std::initializer_list<ValueTp> il = { ValueTp(1), ValueTp(2) };
cc->expect<ValueTp const&>(2);
}
}
{
- CHECKPOINT("Testing C::insert(Iter, Iter) for *Iter = value_type const&");
+ // Testing C::insert(Iter, Iter) for *Iter = value_type const&"
Container c;
const ValueTp ValueList[] = { ValueTp(1), ValueTp(2), ValueTp(3) };
cc->expect<ValueTp const&>(3);
}
}
{
- CHECKPOINT("Testing C::insert(Iter, Iter) for *Iter = value_type&&");
+ // Testing C::insert(Iter, Iter) for *Iter = value_type&&"
Container c;
ValueTp ValueList[] = { ValueTp(1), ValueTp(2) , ValueTp(3) };
cc->expect<ValueTp&&>(3);
}
}
{
- CHECKPOINT("Testing C::insert(Iter, Iter) for *Iter = value_type&");
+ // Testing C::insert(Iter, Iter) for *Iter = value_type&"
Container c;
ValueTp ValueList[] = { ValueTp(1), ValueTp(2) , ValueTp(3) };
cc->expect<ValueTp const&>(3);
ConstructController* cc = getConstructController();
cc->reset();
{
- CHECKPOINT("Testing C::emplace(const value_type&)");
+ // Testing C::emplace(const value_type&)"
Container c;
const ValueTp v(42);
cc->expect<const ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::emplace(value_type&)");
+ // Testing C::emplace(value_type&)"
Container c;
ValueTp v(42);
cc->expect<ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::emplace(value_type&&)");
+ // Testing C::emplace(value_type&&)"
Container c;
ValueTp v(42);
cc->expect<ValueTp&&>();
}
}
{
- CHECKPOINT("Testing C::emplace(const value_type&&)");
+ // Testing C::emplace(const value_type&&)"
Container c;
const ValueTp v(42);
cc->expect<const ValueTp&&>();
ConstructController* cc = getConstructController();
cc->reset();
{
- CHECKPOINT("Testing C::emplace_hint(p, const value_type&)");
+ // Testing C::emplace_hint(p, const value_type&)"
Container c;
const ValueTp v(42);
cc->expect<const ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::emplace_hint(p, value_type&)");
+ // Testing C::emplace_hint(p, value_type&)"
Container c;
ValueTp v(42);
cc->expect<ValueTp&>();
}
}
{
- CHECKPOINT("Testing C::emplace_hint(p, value_type&&)");
+ // Testing C::emplace_hint(p, value_type&&)"
Container c;
ValueTp v(42);
cc->expect<ValueTp&&>();
}
}
{
- CHECKPOINT("Testing C::emplace_hint(p, const value_type&&)");
+ // Testing C::emplace_hint(p, const value_type&&)"
Container c;
const ValueTp v(42);
cc->expect<const ValueTp&&>();
ConstructController* cc = getConstructController();
cc->reset();
{
- CHECKPOINT("Testing C::insert(const value_type&)");
+ // Testing C::insert(const value_type&)"
Container c;
const ValueTp v(42);
cc->expect<const ValueTp&>();
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(value_type&)");
+ // Testing C::insert(value_type&)"
Container c;
ValueTp v(42);
cc->expect<const ValueTp&>();
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(value_type&&)");
+ // Testing C::insert(value_type&&)"
Container c;
ValueTp v(42);
cc->expect<ValueTp&&>();
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(std::initializer_list<ValueTp>)");
+ // Testing C::insert(std::initializer_list<ValueTp>)"
Container c;
std::initializer_list<ValueTp> il = { ValueTp(1), ValueTp(2) };
cc->expect<ValueTp const&>(2);
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(Iter, Iter) for *Iter = value_type const&");
+ // Testing C::insert(Iter, Iter) for *Iter = value_type const&"
Container c;
const ValueTp ValueList[] = { ValueTp(1), ValueTp(2), ValueTp(3) };
cc->expect<ValueTp const&>(3);
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(Iter, Iter) for *Iter = value_type&&");
+ // Testing C::insert(Iter, Iter) for *Iter = value_type&&"
Container c;
ValueTp ValueList[] = { ValueTp(1), ValueTp(2) , ValueTp(3) };
cc->expect<ValueTp&&>(3);
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::insert(Iter, Iter) for *Iter = value_type&");
+ // Testing C::insert(Iter, Iter) for *Iter = value_type&"
Container c;
ValueTp ValueList[] = { ValueTp(1), ValueTp(2) , ValueTp(1) };
cc->expect<ValueTp&>(3);
ConstructController* cc = getConstructController();
cc->reset();
{
- CHECKPOINT("Testing C::emplace(const value_type&)");
+ // Testing C::emplace(const value_type&)"
Container c;
const ValueTp v(42);
cc->expect<const ValueTp&>();
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::emplace(value_type&)");
+ // Testing C::emplace(value_type&)"
Container c;
ValueTp v(42);
cc->expect<ValueTp&>();
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::emplace(value_type&&)");
+ // Testing C::emplace(value_type&&)"
Container c;
ValueTp v(42);
cc->expect<ValueTp&&>();
assert(!cc->unchecked());
}
{
- CHECKPOINT("Testing C::emplace(const value_type&&)");
+ // Testing C::emplace(const value_type&&)"
Container c;
const ValueTp v(42);
cc->expect<const ValueTp&&>();
#include "test_iterators.h"
#include "count_new.h"
#include "filesystem_test_helper.h"
-#include "assert_checkpoint.h"
#include "verbose_assert.h"
struct ComparePathExact {
{
using namespace fs;
for (auto const & TC : PathTestCases) {
- CHECKPOINT(TC.raw.c_str());
fs::path p(TC.raw);
ASSERT(p == TC.raw);
{
using namespace fs;
for (auto const & TC : FilenameTestCases) {
- CHECKPOINT(TC.raw.c_str());
fs::path p(TC.raw);
ASSERT_EQ(p, TC.raw);
ASSERT_NOEXCEPT(p.empty());
#include "test_iterators.h"
#include "count_new.h"
#include "filesystem_test_helper.h"
-#include "assert_checkpoint.h"
#include "verbose_assert.h"
struct ReplaceFilenameTestcase {
+++ /dev/null
-#ifndef SUPPORT_ASSERT_CHECKPOINT_H
-#define SUPPORT_ASSERT_CHECKPOINT_H
-
-#include <csignal>
-#include <iostream>
-#include <cstdlib>
-
-struct Checkpoint {
- const char* file;
- const char* func;
- int line;
- const char* msg;
-
- Checkpoint() : file(nullptr), func(nullptr), line(-1), msg(nullptr) {}
- Checkpoint(const char* xfile, const char* xfunc, int xline, const char* xmsg)
- : file(xfile), func(xfunc), line(xline), msg(xmsg)
- {}
-
- template <class Stream>
- void print(Stream& s) const {
- if (!file) {
- s << "NO CHECKPOINT\n";
- return;
- }
- s << file << ":" << line << " " << func << ": Checkpoint";
- if (msg)
- s << " '" << msg << "'";
- s << std::endl;
- }
-};
-
-inline Checkpoint& globalCheckpoint() {
- static Checkpoint C;
- return C;
-}
-
-inline void clearCheckpoint() {
- globalCheckpoint() = Checkpoint();
-}
-
-#if defined(__GNUC__)
-#define CHECKPOINT_FUNCTION_NAME __PRETTY_FUNCTION__
-#else
-#define CHECKPOINT_FUNCTION_NAME __func__
-#endif
-
-#define CHECKPOINT(msg) globalCheckpoint() = Checkpoint(__FILE__, CHECKPOINT_FUNCTION_NAME, __LINE__, msg);
-
-inline void checkpointSignalHandler(int signal) {
- if (signal == SIGABRT) {
- globalCheckpoint().print(std::cerr);
- } else {
- std::cerr << "Unexpected signal " << signal << " received\n";
- }
- std::_Exit(EXIT_FAILURE);
-}
-
-inline bool initCheckpointHandler() {
- typedef void(*HandlerT)(int);
- static bool isInit = false;
- if (isInit) return true;
- HandlerT prev_h = std::signal(SIGABRT, checkpointSignalHandler);
- if (prev_h == SIG_ERR) {
- std::cerr << "Setup failed.\n";
- std::_Exit(EXIT_FAILURE);
- }
- isInit = true;
- return false;
-}
-
-static bool initDummy = initCheckpointHandler();
-
-#endif
#include "test_macros.h"
#include "debug_mode_helper.h"
-#include "assert_checkpoint.h"
#include "test_allocator.h"
// These test make use of 'if constexpr'.
// Iterator tests
template <class Iter>
static void TestNullIterators() {
- CHECKPOINT("testing null iterator");
+ // testing null iterator
Iter it;
EXPECT_DEATH( ++it );
EXPECT_DEATH( it++ );
}
static void DecrementBegin() {
- CHECKPOINT("testing decrement on begin");
+ // testing decrement on begin
Container C = makeContainer(1);
iterator i = C.end();
const_iterator ci = C.cend();
}
static void IncrementEnd() {
- CHECKPOINT("testing increment on end");
+ // testing increment on end
Container C = makeContainer(1);
iterator i = C.begin();
const_iterator ci = C.begin();
}
static void DerefEndIterator() {
- CHECKPOINT("testing deref end iterator");
+ // testing deref end iterator
Container C = makeContainer(1);
iterator i = C.begin();
const_iterator ci = C.cbegin();
// Container tests
static void CopyInvalidatesIterators() {
- CHECKPOINT("copy invalidates iterators");
+ // copy invalidates iterators
Container C1 = makeContainer(3);
iterator i = C1.begin();
Container C2 = C1;
}
static void MoveInvalidatesIterators() {
- CHECKPOINT("copy move invalidates iterators");
+ // copy move invalidates iterators
Container C1 = makeContainer(3);
iterator i = C1.begin();
Container C2 = std::move(C1);
}
static void EraseIter() {
- CHECKPOINT("testing erase invalidation");
+ // testing erase invalidation
Container C1 = makeContainer(2);
iterator it1 = C1.begin();
iterator it1_next = it1;
}
static void EraseIterIter() {
- CHECKPOINT("testing erase iter iter invalidation");
+ // testing erase iter iter invalidation
Container C1 = makeContainer(2);
iterator it1 = C1.begin();
iterator it1_next = it1;
// Allocator aware tests
static void SwapInvalidatesIterators() {
- CHECKPOINT("testing swap invalidates iterators");
+ // testing swap invalidates iterators
Container C1 = makeContainer(3);
Container C2 = makeContainer(3);
iterator it1 = C1.begin();
}
static void SwapNonEqualAllocators() {
- CHECKPOINT("testing swap with non-equal allocators");
+ // testing swap with non-equal allocators
Container C1 = makeContainer(3, allocator_type(1));
Container C2 = makeContainer(1, allocator_type(2));
Container C3 = makeContainer(2, allocator_type(2));
#include <unistd.h>
#include <sys/wait.h>
#include "test_macros.h"
-#include "assert_checkpoint.h"
#include "test_allocator.h"
#if TEST_STD_VER < 11