Classes | Namespaces | Enumerations | Functions | Variables
logging_custom_prefix_unittest.cc File Reference
#include "utilities.h"
#include <fcntl.h>
#include <sys/stat.h>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <memory>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include "base/commandlineflags.h"
#include <glog/logging.h>
#include <glog/raw_logging.h>
#include "googletest.h"
Include dependency graph for logging_custom_prefix_unittest.cc:

Go to the source code of this file.

Classes

struct  MyLogger
 
struct  NewHook
 
struct  RecordDeletionLogger
 
class  TestLogSinkImpl
 
class  TestLogSinkWriter
 
class  TestWaitingLogSink
 
struct  UserDefinedClass
 

Namespaces

 base
 
 base::internal
 
 glog_internal_namespace_
 

Enumerations

enum  { CASE_A, CASE_B }
 

Functions

static void BM_Check1 (int n)
 
static void BM_Check2 (int n)
 
static void BM_Check3 (int n)
 
static void BM_logspeed (int n)
 
static void BM_vlog (int n)
 
static void CheckFailure (int a, int b, const char *file, int line, const char *msg)
 
static void CheckFile (const string &name, const string &expected_string, const bool checkInFileOrNot=true)
 
 DECLARE_string (log_backtrace_at)
 
static void DeleteFiles (const string &pattern)
 
bool base::internal::GetExitOnDFatal ()
 
static void GetFiles (const string &pattern, vector< string > *files)
 
static void LogWithLevels (int v, int severity, bool err, bool alsoerr)
 
int main (int argc, char **argv)
 
static void NoAllocNewHook ()
 
ostream & operator<< (ostream &out, const UserDefinedClass &)
 
void PrefixAttacher (std::ostream &s, const LogMessageInfo &l, void *data)
 
bool glog_internal_namespace_::SafeFNMatch_ (const char *pattern, size_t patt_len, const char *str, size_t str_len)
 
void base::internal::SetExitOnDFatal (bool value)
 
 TEST (CheckNOTNULL, Simple)
 
 TEST (DeathCheckNN, Simple)
 
 TEST (DeathNoAllocNewHook, logging)
 
 TEST (DeathRawCHECK, logging)
 
 TEST (DeathSTREQ, logging)
 
 TEST (LogMsgTime, gmtoff)
 
 TEST (SafeFNMatch, logging)
 
 TEST (Strerror, logging)
 
 TEST (UserDefinedClass, logging)
 
static void TestBasename ()
 
static void TestBasenameAppendWhenNoTimestamp ()
 
static void TestCHECK ()
 
static void TestCustomLoggerDeletionOnShutdown ()
 
static void TestDCHECK ()
 
static void TestErrno ()
 
static void TestExtension ()
 
static _END_GOOGLE_NAMESPACE_ void TestLogging (bool check_counts)
 
static void TestLoggingLevels ()
 
static void TestLogSink ()
 
static void TestLogSinkWaitTillSent ()
 
static void TestLogString ()
 
static void TestLogToString ()
 
static void TestOneTruncate (const char *path, uint64 limit, uint64 keep, size_t dsize, size_t ksize, size_t expect)
 
static void TestRawLogging ()
 
static void TestSTREQ ()
 
static void TestSymlink ()
 
static void TestTruncate ()
 
static void TestTwoProcessesWrite ()
 
static void TestWrapper ()
 
static _END_GOOGLE_NAMESPACE_ bool WrapSafeFNMatch (string pattern, string str)
 

Variables

static vector< stringglobal_messages
 
static int x = -1
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CASE_A 
CASE_B 

Definition at line 572 of file logging_custom_prefix_unittest.cc.

Function Documentation

◆ BM_Check1()

static void BM_Check1 ( int  n)
static

Definition at line 119 of file logging_custom_prefix_unittest.cc.

◆ BM_Check2()

static void BM_Check2 ( int  n)
static

Definition at line 148 of file logging_custom_prefix_unittest.cc.

◆ BM_Check3()

static void BM_Check3 ( int  n)
static

Definition at line 134 of file logging_custom_prefix_unittest.cc.

◆ BM_logspeed()

static void BM_logspeed ( int  n)
static

Definition at line 169 of file logging_custom_prefix_unittest.cc.

◆ BM_vlog()

static void BM_vlog ( int  n)
static

Definition at line 176 of file logging_custom_prefix_unittest.cc.

◆ CheckFailure()

static void CheckFailure ( int  a,
int  b,
const char *  file,
int  line,
const char *  msg 
)
static

Definition at line 165 of file logging_custom_prefix_unittest.cc.

◆ CheckFile()

static void CheckFile ( const string name,
const string expected_string,
const bool  checkInFileOrNot = true 
)
static

Definition at line 705 of file logging_custom_prefix_unittest.cc.

◆ DECLARE_string()

DECLARE_string ( log_backtrace_at  )

◆ DeleteFiles()

static void DeleteFiles ( const string pattern)
static

Definition at line 696 of file logging_custom_prefix_unittest.cc.

◆ GetFiles()

static void GetFiles ( const string pattern,
vector< string > *  files 
)
static

Definition at line 663 of file logging_custom_prefix_unittest.cc.

◆ LogWithLevels()

void LogWithLevels ( int  v,
int  severity,
bool  err,
bool  alsoerr 
)
static

Definition at line 408 of file logging_custom_prefix_unittest.cc.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 207 of file logging_custom_prefix_unittest.cc.

◆ NoAllocNewHook()

static void NoAllocNewHook ( )
static

Definition at line 333 of file logging_custom_prefix_unittest.cc.

◆ operator<<()

ostream& operator<< ( ostream &  out,
const UserDefinedClass  
)
inline

Definition at line 1356 of file logging_custom_prefix_unittest.cc.

◆ PrefixAttacher()

void PrefixAttacher ( std::ostream &  s,
const LogMessageInfo &  l,
void data 
)

Definition at line 184 of file logging_custom_prefix_unittest.cc.

◆ TEST() [1/9]

TEST ( CheckNOTNULL  ,
Simple   
)

Definition at line 647 of file logging_custom_prefix_unittest.cc.

◆ TEST() [2/9]

TEST ( DeathCheckNN  ,
Simple   
)

Definition at line 658 of file logging_custom_prefix_unittest.cc.

◆ TEST() [3/9]

TEST ( DeathNoAllocNewHook  ,
logging   
)

Definition at line 346 of file logging_custom_prefix_unittest.cc.

◆ TEST() [4/9]

TEST ( DeathRawCHECK  ,
logging   
)

Definition at line 486 of file logging_custom_prefix_unittest.cc.

◆ TEST() [5/9]

TEST ( DeathSTREQ  ,
logging   
)

Definition at line 637 of file logging_custom_prefix_unittest.cc.

◆ TEST() [6/9]

TEST ( LogMsgTime  ,
gmtoff   
)

Definition at line 1372 of file logging_custom_prefix_unittest.cc.

◆ TEST() [7/9]

TEST ( SafeFNMatch  ,
logging   
)

Definition at line 1018 of file logging_custom_prefix_unittest.cc.

◆ TEST() [8/9]

TEST ( Strerror  ,
logging   
)

Definition at line 1194 of file logging_custom_prefix_unittest.cc.

◆ TEST() [9/9]

TEST ( UserDefinedClass  ,
logging   
)

Definition at line 1361 of file logging_custom_prefix_unittest.cc.

◆ TestBasename()

static void TestBasename ( )
static

Definition at line 726 of file logging_custom_prefix_unittest.cc.

◆ TestBasenameAppendWhenNoTimestamp()

static void TestBasenameAppendWhenNoTimestamp ( )
static

Definition at line 742 of file logging_custom_prefix_unittest.cc.

◆ TestCHECK()

void TestCHECK ( )
static

Definition at line 577 of file logging_custom_prefix_unittest.cc.

◆ TestCustomLoggerDeletionOnShutdown()

static void TestCustomLoggerDeletionOnShutdown ( )
static

Definition at line 991 of file logging_custom_prefix_unittest.cc.

◆ TestDCHECK()

void TestDCHECK ( )
static

Definition at line 603 of file logging_custom_prefix_unittest.cc.

◆ TestErrno()

static void TestErrno ( )
static

Definition at line 870 of file logging_custom_prefix_unittest.cc.

◆ TestExtension()

static void TestExtension ( )
static

Definition at line 820 of file logging_custom_prefix_unittest.cc.

◆ TestLogging()

void TestLogging ( bool  check_counts)
static

Definition at line 283 of file logging_custom_prefix_unittest.cc.

◆ TestLoggingLevels()

void TestLoggingLevels ( )
static

Definition at line 473 of file logging_custom_prefix_unittest.cc.

◆ TestLogSink()

void TestLogSink ( )
static

Definition at line 538 of file logging_custom_prefix_unittest.cc.

◆ TestLogSinkWaitTillSent()

static void TestLogSinkWaitTillSent ( )
static

Definition at line 1177 of file logging_custom_prefix_unittest.cc.

◆ TestLogString()

void TestLogString ( )
static

Definition at line 493 of file logging_custom_prefix_unittest.cc.

◆ TestLogToString()

void TestLogToString ( )
static

Definition at line 510 of file logging_custom_prefix_unittest.cc.

◆ TestOneTruncate()

static void TestOneTruncate ( const char *  path,
uint64  limit,
uint64  keep,
size_t  dsize,
size_t  ksize,
size_t  expect 
)
static

Definition at line 878 of file logging_custom_prefix_unittest.cc.

◆ TestRawLogging()

void TestRawLogging ( )
static

Definition at line 354 of file logging_custom_prefix_unittest.cc.

◆ TestSTREQ()

void TestSTREQ ( )
static

Definition at line 623 of file logging_custom_prefix_unittest.cc.

◆ TestSymlink()

static void TestSymlink ( )
static

Definition at line 801 of file logging_custom_prefix_unittest.cc.

◆ TestTruncate()

static void TestTruncate ( )
static

Definition at line 925 of file logging_custom_prefix_unittest.cc.

◆ TestTwoProcessesWrite()

static void TestTwoProcessesWrite ( )
static

Definition at line 768 of file logging_custom_prefix_unittest.cc.

◆ TestWrapper()

static void TestWrapper ( )
static

Definition at line 857 of file logging_custom_prefix_unittest.cc.

◆ WrapSafeFNMatch()

static _END_GOOGLE_NAMESPACE_ bool WrapSafeFNMatch ( string  pattern,
string  str 
)
static

Definition at line 1011 of file logging_custom_prefix_unittest.cc.

Variable Documentation

◆ global_messages

vector<string> global_messages
static

Definition at line 1041 of file logging_custom_prefix_unittest.cc.

◆ x

int x = -1
static

Definition at line 118 of file logging_custom_prefix_unittest.cc.



libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:03