webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Namespaces | Macros | Functions | Variables
gflags_unittest.cc File Reference
#include "config_for_unittests.h"
#include <gflags/gflags.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <string>
#include "util.h"
#include <gflags/gflags_completions.h>

Namespaces

 fLI
 
 GFLAGS_NAMESPACE
 

Macros

#define MAKEFLAG(x)   DEFINE_int32(test_flag_num##x, x, "Test flag")
 
#define MAKEFLAG10(x)
 
#define MAKEFLAG100(x)
 

Functions

 DEFINE_string (test_tmpdir, "", "Dir we use for temp files")
 
 DEFINE_string (srcdir, StringFromEnv("SRCDIR", "."), "Source-dir root, needed to find gflags_unittest_flagfile")
 
 DECLARE_string (tryfromenv)
 
 DEFINE_bool (test_bool, false, "tests bool-ness")
 
 DEFINE_int32 (test_int32, -1, "")
 
 DEFINE_int64 (test_int64, -2, "")
 
 DEFINE_uint64 (test_uint64, 2, "")
 
 DEFINE_double (test_double, -1.0, "")
 
 DEFINE_string (test_string, "initial", "")
 
 DEFINE_bool (test_bool_with_quite_quite_quite_quite_quite_quite_quite_quite_quite_quite_quite_quite_quite_quite_long_name, false, "extremely_extremely_extremely_extremely_extremely_extremely_extremely_extremely_long_meaning")
 
 DEFINE_string (test_str1, "initial", "")
 
 DEFINE_string (test_str2, "initial", "")
 
 DEFINE_string (test_str3, "initial", "")
 
 DEFINE_string (test_tryfromenv, "initial", "")
 
 DEFINE_int32 (changeable_var,++changeable_var, "")
 
 DEFINE_bool (changeable_bool_var,++changeable_bool_var==8009, "")
 
 DEFINE_string (changeable_string_var, ChangeableString(), "")
 
 DEFINE_bool (unused_bool, true, "unused bool-ness")
 
 DEFINE_int32 (unused_int32, -1001, "")
 
 DEFINE_int64 (unused_int64, -2001, "")
 
 DEFINE_uint64 (unused_uint64, 2000, "")
 
 DEFINE_double (unused_double, -1000.0, "")
 
 DEFINE_string (unused_string, "unused", "")
 
 DEFINE_bool (changed_bool1, false, "changed")
 
 DEFINE_bool (changed_bool2, false, "changed")
 
 DEFINE_bool (long_helpstring, false, "This helpstring goes on forever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever. This is the end of a long helpstring")
 
 DEFINE_bool (always_fail, false, "will fail to validate when you set it")
 
 DEFINE_validator (always_fail, AlwaysFail)
 
 DEFINE_bool (deadlock_if_cant_lock, false, "will deadlock if set to true and " "if locking of registry in validators fails.")
 
 DEFINE_validator (deadlock_if_cant_lock, DeadlockIfCantLockInValidators)
 
 MAKEFLAG100 (1)
 
 MAKEFLAG100 (2)
 
 MAKEFLAG100 (3)
 
 MAKEFLAG100 (4)
 
 MAKEFLAG100 (5)
 
 MAKEFLAG100 (6)
 
 MAKEFLAG100 (7)
 
 MAKEFLAG100 (8)
 
 MAKEFLAG100 (9)
 
 MAKEFLAG100 (10)
 
 MAKEFLAG100 (11)
 
 MAKEFLAG100 (12)
 
 MAKEFLAG100 (13)
 
 MAKEFLAG100 (14)
 
 MAKEFLAG100 (15)
 
int main (int argc, char **argv)
 

Variables

TEST_INIT EXPECT_DEATH_INIT void(* unused_fn )() = &GFLAGS_NAMESPACE::HandleCommandLineCompletions
 
int32 fLI::FLAGS_tldflag1 = FLAGS_nonotldflag1
 
int32 fLI::FLAGS_notldflag1 = FLAGS_nonotldflag1
 
int32 fLI::FLAGS_tldflag2 = FLAGS_nonotldflag2
 
int32 fLI::FLAGS_notldflag2 = FLAGS_nonotldflag2
 

Macro Definition Documentation

◆ MAKEFLAG

#define MAKEFLAG (   x)    DEFINE_int32(test_flag_num##x, x, "Test flag")

◆ MAKEFLAG10

#define MAKEFLAG10 (   x)
Value:
MAKEFLAG(x##0); \
MAKEFLAG(x##1); \
MAKEFLAG(x##2); \
MAKEFLAG(x##3); \
MAKEFLAG(x##4); \
MAKEFLAG(x##5); \
MAKEFLAG(x##6); \
MAKEFLAG(x##7); \
MAKEFLAG(x##8); \
MAKEFLAG(x##9)
EGLSurface EGLint x
Definition: eglext.h:950
#define MAKEFLAG(x)
Definition: gflags_unittest.cc:157

◆ MAKEFLAG100

#define MAKEFLAG100 (   x)
Value:
MAKEFLAG10(x##0); \
MAKEFLAG10(x##1); \
MAKEFLAG10(x##2); \
MAKEFLAG10(x##3); \
MAKEFLAG10(x##4); \
MAKEFLAG10(x##5); \
MAKEFLAG10(x##6); \
MAKEFLAG10(x##7); \
MAKEFLAG10(x##8); \
MAKEFLAG10(x##9)
EGLSurface EGLint x
Definition: eglext.h:950
#define MAKEFLAG10(x)
Definition: gflags_unittest.cc:160

Function Documentation

◆ DECLARE_string()

DECLARE_string ( tryfromenv  )

◆ DEFINE_bool() [1/9]

DEFINE_bool ( test_bool  ,
false  ,
"tests bool-ness"   
)

◆ DEFINE_bool() [2/9]

DEFINE_bool ( test_bool_with_quite_quite_quite_quite_quite_quite_quite_quite_quite_quite_quite_quite_quite_quite_long_name  ,
false  ,
"extremely_extremely_extremely_extremely_extremely_extremely_extremely_extremely_long_meaning"   
)

◆ DEFINE_bool() [3/9]

DEFINE_bool ( changeable_bool_var  ,
++  changeable_bool_var = =8009,
""   
)

◆ DEFINE_bool() [4/9]

DEFINE_bool ( unused_bool  ,
true  ,
"unused bool-ness"   
)

◆ DEFINE_bool() [5/9]

DEFINE_bool ( changed_bool1  ,
false  ,
"changed"   
)

◆ DEFINE_bool() [6/9]

DEFINE_bool ( changed_bool2  ,
false  ,
"changed"   
)

◆ DEFINE_bool() [7/9]

DEFINE_bool ( long_helpstring  ,
false  ,
"This helpstring goes on forever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever and ever and ever and ever and ever and ever and ever and " "ever. This is the end of a long helpstring"   
)

◆ DEFINE_bool() [8/9]

DEFINE_bool ( always_fail  ,
false  ,
"will fail to validate when you set it"   
)

◆ DEFINE_bool() [9/9]

DEFINE_bool ( deadlock_if_cant_lock  ,
false  ,
"will deadlock if set to true and " "if locking of registry in validators fails."   
)

◆ DEFINE_double() [1/2]

DEFINE_double ( test_double  ,
-1.  0,
""   
)

◆ DEFINE_double() [2/2]

DEFINE_double ( unused_double  ,
-1000.  0,
""   
)

◆ DEFINE_int32() [1/3]

DEFINE_int32 ( test_int32  ,
1,
""   
)

◆ DEFINE_int32() [2/3]

DEFINE_int32 ( changeable_var  ,
++  changeable_var,
""   
)

◆ DEFINE_int32() [3/3]

DEFINE_int32 ( unused_int32  ,
1001,
""   
)

◆ DEFINE_int64() [1/2]

DEFINE_int64 ( test_int64  ,
2,
""   
)

◆ DEFINE_int64() [2/2]

DEFINE_int64 ( unused_int64  ,
2001,
""   
)

◆ DEFINE_string() [1/9]

DEFINE_string ( test_tmpdir  ,
""  ,
"Dir we use for temp files"   
)

◆ DEFINE_string() [2/9]

DEFINE_string ( srcdir  ,
StringFromEnv("SRCDIR", ".")  ,
"Source-dir  root,
needed to find gflags_unittest_flagfile"   
)

◆ DEFINE_string() [3/9]

DEFINE_string ( test_string  ,
"initial"  ,
""   
)

◆ DEFINE_string() [4/9]

DEFINE_string ( test_str1  ,
"initial"  ,
""   
)

◆ DEFINE_string() [5/9]

DEFINE_string ( test_str2  ,
"initial"  ,
""   
)

◆ DEFINE_string() [6/9]

DEFINE_string ( test_str3  ,
"initial"  ,
""   
)

◆ DEFINE_string() [7/9]

DEFINE_string ( test_tryfromenv  ,
"initial"  ,
""   
)

◆ DEFINE_string() [8/9]

DEFINE_string ( changeable_string_var  ,
ChangeableString()  ,
""   
)

◆ DEFINE_string() [9/9]

DEFINE_string ( unused_string  ,
"unused"  ,
""   
)

◆ DEFINE_uint64() [1/2]

DEFINE_uint64 ( test_uint64  ,
,
""   
)

◆ DEFINE_uint64() [2/2]

DEFINE_uint64 ( unused_uint64  ,
2000  ,
""   
)

◆ DEFINE_validator() [1/2]

DEFINE_validator ( always_fail  ,
AlwaysFail   
)

◆ DEFINE_validator() [2/2]

DEFINE_validator ( deadlock_if_cant_lock  ,
DeadlockIfCantLockInValidators   
)

◆ main()

int main ( int  argc,
char **  argv 
)

◆ MAKEFLAG100() [1/15]

MAKEFLAG100 ( )

◆ MAKEFLAG100() [2/15]

MAKEFLAG100 ( )

◆ MAKEFLAG100() [3/15]

MAKEFLAG100 ( )

◆ MAKEFLAG100() [4/15]

MAKEFLAG100 ( )

◆ MAKEFLAG100() [5/15]

MAKEFLAG100 ( )

◆ MAKEFLAG100() [6/15]

MAKEFLAG100 ( )

◆ MAKEFLAG100() [7/15]

MAKEFLAG100 ( )

◆ MAKEFLAG100() [8/15]

MAKEFLAG100 ( )

◆ MAKEFLAG100() [9/15]

MAKEFLAG100 ( )

◆ MAKEFLAG100() [10/15]

MAKEFLAG100 ( 10  )

◆ MAKEFLAG100() [11/15]

MAKEFLAG100 ( 11  )

◆ MAKEFLAG100() [12/15]

MAKEFLAG100 ( 12  )

◆ MAKEFLAG100() [13/15]

MAKEFLAG100 ( 13  )

◆ MAKEFLAG100() [14/15]

MAKEFLAG100 ( 14  )

◆ MAKEFLAG100() [15/15]

MAKEFLAG100 ( 15  )

Variable Documentation

◆ unused_fn