Merge pull request #281 from sergiud/msvc-error-define
authorSergiu Deitsch <sergiud@users.noreply.github.com>
Tue, 2 Jan 2018 01:21:51 +0000 (02:21 +0100)
committerGitHub <noreply@github.com>
Tue, 2 Jan 2018 01:21:51 +0000 (02:21 +0100)
Fixed undeclared identifier error

1  2 
src/logging_unittest.cc

diff --combined src/logging_unittest.cc
@@@ -273,7 -273,7 +273,7 @@@ void TestLogging(bool check_counts) 
               << setw(1) << hex << j;
  
    {
-     google::LogMessage outer(__FILE__, __LINE__, google::ERROR);
+     google::LogMessage outer(__FILE__, __LINE__, GLOG_ERROR);
      outer.stream() << "outer";
  
      LOG(ERROR) << "inner";
@@@ -775,18 -775,17 +775,18 @@@ static void TestOneTruncate(const char 
    CHECK_ERR(fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0600));
  
    const char *discardstr = "DISCARDME!", *keepstr = "KEEPME!";
 +  const size_t discard_size = strlen(discardstr), keep_size = strlen(keepstr);
  
    // Fill the file with the requested data; first discard data, then kept data
    int64 written = 0;
    while (written < dsize) {
 -    int bytes = min<int64>(dsize - written, strlen(discardstr));
 +    int bytes = min<int64>(dsize - written, discard_size);
      CHECK_ERR(write(fd, discardstr, bytes));
      written += bytes;
    }
    written = 0;
    while (written < ksize) {
 -    int bytes = min<int64>(ksize - written, strlen(keepstr));
 +    int bytes = min<int64>(ksize - written, keep_size);
      CHECK_ERR(write(fd, keepstr, bytes));
      written += bytes;
    }
    const char *p = buf;
    int64 checked = 0;
    while (checked < expect) {
 -    int bytes = min<int64>(expect - checked, strlen(keepstr));
 +    int bytes = min<int64>(expect - checked, keep_size);
      CHECK(!memcmp(p, keepstr, bytes));
      checked += bytes;
    }