Change naming convention from _member to member_ (fixes #1905)

This commit is contained in:
Benoit Blanchon
2023-04-07 09:02:23 +02:00
parent 4ba9c1b0c0
commit 31ce648e63
64 changed files with 802 additions and 794 deletions

View File

@ -10,29 +10,29 @@
class SpyingAllocator {
public:
SpyingAllocator(const SpyingAllocator& src) : _log(src._log) {}
SpyingAllocator(std::ostream& log) : _log(log) {}
SpyingAllocator(const SpyingAllocator& src) : log_(src.log_) {}
SpyingAllocator(std::ostream& log) : log_(log) {}
SpyingAllocator& operator=(const SpyingAllocator& src) = delete;
void* allocate(size_t n) {
_log << "A" << n;
log_ << "A" << n;
return malloc(n);
}
void deallocate(void* p) {
_log << "F";
log_ << "F";
free(p);
}
private:
std::ostream& _log;
std::ostream& log_;
};
class ControllableAllocator {
public:
ControllableAllocator() : _enabled(true) {}
ControllableAllocator() : enabled_(true) {}
void* allocate(size_t n) {
return _enabled ? malloc(n) : 0;
return enabled_ ? malloc(n) : 0;
}
void deallocate(void* p) {
@ -40,11 +40,11 @@ class ControllableAllocator {
}
void disable() {
_enabled = false;
enabled_ = false;
}
private:
bool _enabled;
bool enabled_;
};
TEST_CASE("BasicJsonDocument") {