37 #include "gmock/internal/gmock-internal-utils.h"
49 #include "gmock/gmock.h"
50 #include "gmock/internal/gmock-port.h"
51 #include "gtest/gtest.h"
64 const auto build_one = [&](
const size_t i) {
68 for (
size_t i = 1;
i <
values.size();
i++) {
82 char prev_char =
'\0';
83 for (
const char* p = id_name; *p !=
'\0'; prev_char = *(p++)) {
86 const bool starts_new_word =
IsUpper(*p) ||
91 if (starts_new_word &&
result !=
"")
102 class GoogleTestFailureReporter :
public FailureReporterInterface {
126 static FailureReporterInterface*
const failure_reporter =
127 new GoogleTestFailureReporter();
128 return failure_reporter;
158 int stack_frames_to_skip) {
167 std::cout <<
"\nGMOCK WARNING:";
174 if (stack_frames_to_skip >= 0) {
177 const int actual_to_skip = 0;
181 const int actual_to_skip = stack_frames_to_skip + 1;
188 std::cout <<
"Stack trace:\n"
192 std::cout << ::std::flush;
200 "You are using DoDefault() inside a composite action like "
201 "DoAll() or WithArgs(). This is not supported for technical "
202 "reasons. Please instead spell out the default action, or "
203 "assign the default action to an Action variable and use "
204 "the variable in various places.");
207 constexpr
char UnBase64Impl(
char c,
const char*
const base64,
char carry) {
208 return *base64 == 0 ?
static_cast<char>(65)
209 : *base64 == c ? carry
213 template <
size_t...
I>
215 const char*
const base64) {
219 constexpr std::array<char, 256>
UnBase64(
const char*
const base64) {
224 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
229 size_t encoded_len = encoded.size();
230 decoded->reserve(3 * (encoded_len / 4) + (encoded_len % 4));
233 for (
int src : encoded) {
234 if (std::isspace(src) || src ==
'=') {
237 char src_bin =
kUnBase64[
static_cast<size_t>(src)];
246 dst |=
static_cast<char>(src_bin >> (bit_pos - 2));
247 decoded->push_back(
dst);
248 dst =
static_cast<char>(src_bin << (10 - bit_pos));
249 bit_pos = (bit_pos + 6) % 8;