forked from bblanchon/ArduinoJson
Change naming convention from _member
to member_
(fixes #1905)
Ported from 31ce648e63
This commit is contained in:
@ -170,19 +170,19 @@ TEST_CASE("IteratorReader") {
|
||||
|
||||
class StreamStub : public Stream {
|
||||
public:
|
||||
StreamStub(const char* s) : _stream(s) {}
|
||||
StreamStub(const char* s) : stream_(s) {}
|
||||
|
||||
int read() {
|
||||
return _stream.get();
|
||||
return stream_.get();
|
||||
}
|
||||
|
||||
size_t readBytes(char* buffer, size_t length) {
|
||||
_stream.read(buffer, static_cast<std::streamsize>(length));
|
||||
return static_cast<size_t>(_stream.gcount());
|
||||
stream_.read(buffer, static_cast<std::streamsize>(length));
|
||||
return static_cast<size_t>(stream_.gcount());
|
||||
}
|
||||
|
||||
private:
|
||||
std::istringstream _stream;
|
||||
std::istringstream stream_;
|
||||
};
|
||||
|
||||
TEST_CASE("Reader<Stream>") {
|
||||
|
@ -52,5 +52,8 @@
|
||||
#define BLOCKSIZE
|
||||
#define CAPACITY
|
||||
|
||||
// issue #1905
|
||||
#define _current
|
||||
|
||||
// catch.hpp mutes several warnings, this file also allows to detect them
|
||||
#include "ArduinoJson.h"
|
||||
|
@ -34,21 +34,21 @@ struct PrintAllAtOnce {
|
||||
|
||||
template <typename PrintPolicy>
|
||||
struct PrintableString : public Printable {
|
||||
PrintableString(const char* s) : _str(s), _total(0) {}
|
||||
PrintableString(const char* s) : str_(s), total_(0) {}
|
||||
|
||||
virtual size_t printTo(Print& p) const {
|
||||
size_t result = PrintPolicy::printStringTo(_str, p);
|
||||
_total += result;
|
||||
size_t result = PrintPolicy::printStringTo(str_, p);
|
||||
total_ += result;
|
||||
return result;
|
||||
}
|
||||
|
||||
size_t totalBytesWritten() const {
|
||||
return _total;
|
||||
return total_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string _str;
|
||||
mutable size_t _total;
|
||||
std::string str_;
|
||||
mutable size_t total_;
|
||||
};
|
||||
|
||||
TEST_CASE("Printable") {
|
||||
|
Reference in New Issue
Block a user