Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
z
Classes
Class List
Class Hierarchy
Class Members
All
:
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Properties
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
grpc
third_party
boringssl-with-bazel
src
crypto
test
gtest_main.h
Go to the documentation of this file.
1
/* Copyright (c) 2017, Google Inc.
2
*
3
* Permission to use, copy, modify, and/or distribute this software for any
4
* purpose with or without fee is hereby granted, provided that the above
5
* copyright notice and this permission notice appear in all copies.
6
*
7
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
14
15
#ifndef OPENSSL_HEADER_CRYPTO_TEST_GTEST_MAIN_H
16
#define OPENSSL_HEADER_CRYPTO_TEST_GTEST_MAIN_H
17
18
#include <stdio.h>
19
#include <stdlib.h>
20
21
#include <gtest/gtest.h>
22
23
#include <
openssl/crypto.h
>
24
#include <
openssl/err.h
>
25
26
#if defined(OPENSSL_WINDOWS)
27
OPENSSL_MSVC_PRAGMA
(
warning
(
push
, 3))
28
#include <winsock2.h>
29
OPENSSL_MSVC_PRAGMA
(
warning
(pop))
30
#else
31
#include <signal.h>
32
#endif
33
34
35
BSSL_NAMESPACE_BEGIN
36
37
class
ErrorTestEventListener
:
public
testing::EmptyTestEventListener
{
38
public
:
39
ErrorTestEventListener
() {}
40
~ErrorTestEventListener
()
override
{}
41
42
void
OnTestEnd
(
const
testing::TestInfo
&test_info)
override
{
43
if
(test_info.
result
()->
Failed
()) {
44
// The test failed. Print any errors left in the error queue.
45
ERR_print_errors_fp
(
stdout
);
46
}
else
{
47
// The test succeeded, so any failed operations are expected. Clear the
48
// error queue without printing.
49
ERR_clear_error
();
50
}
51
}
52
};
53
54
// SetupGoogleTest should be called by the test runner after
55
// testing::InitGoogleTest has been called and before RUN_ALL_TESTS.
56
inline
void
SetupGoogleTest
() {
57
CRYPTO_library_init
();
58
59
#if defined(OPENSSL_WINDOWS)
60
// Initialize Winsock.
61
WORD wsa_version = MAKEWORD(2, 2);
62
WSADATA wsa_data;
63
int
wsa_err = WSAStartup(wsa_version, &wsa_data);
64
if
(wsa_err != 0) {
65
fprintf(
stderr
,
"WSAStartup failed: %d\n"
, wsa_err);
66
exit(1);
67
}
68
if
(wsa_data.wVersion != wsa_version) {
69
fprintf(
stderr
,
"Didn't get expected version: %x\n"
, wsa_data.wVersion);
70
exit(1);
71
}
72
#else
73
// Some tests create pipes. We check return values, so avoid being killed by
74
// |SIGPIPE|.
75
signal
(SIGPIPE, SIG_IGN);
76
#endif
77
78
testing::UnitTest::GetInstance
()->
listeners
().
Append
(
79
new
ErrorTestEventListener
);
80
}
81
82
BSSL_NAMESPACE_END
83
84
85
#endif // OPENSSL_HEADER_CRYPTO_TEST_GTEST_MAIN_H
testing::UnitTest::listeners
TestEventListeners & listeners()
Definition:
bloaty/third_party/googletest/googletest/src/gtest.cc:4746
testing::TestInfo
Definition:
bloaty/third_party/googletest/googletest/include/gtest/gtest.h:695
demumble_test.stdout
stdout
Definition:
demumble_test.py:38
CRYPTO_library_init
#define CRYPTO_library_init
Definition:
boringssl_prefix_symbols.h:1175
check_version.warning
string warning
Definition:
check_version.py:46
ERR_print_errors_fp
#define ERR_print_errors_fp
Definition:
boringssl_prefix_symbols.h:1437
ErrorTestEventListener::OnTestEnd
void OnTestEnd(const testing::TestInfo &test_info) override
Definition:
gtest_main.h:42
testing::TestEventListeners::Append
void Append(TestEventListener *listener)
Definition:
bloaty/third_party/googletest/googletest/src/gtest.cc:4548
python_utils.port_server.stderr
stderr
Definition:
port_server.py:51
ErrorTestEventListener::ErrorTestEventListener
ErrorTestEventListener()
Definition:
gtest_main.h:39
signal
static void signal(notification *n)
Definition:
alts_tsi_handshaker_test.cc:107
BSSL_NAMESPACE_END
#define BSSL_NAMESPACE_END
Definition:
base.h:480
err.h
crypto.h
OPENSSL_MSVC_PRAGMA
OPENSSL_MSVC_PRAGMA(warning(disable:4702))
Definition:
e_aes.c:69
testing::TestInfo::result
const TestResult * result() const
Definition:
bloaty/third_party/googletest/googletest/include/gtest/gtest.h:761
push
int push(void *desc, unsigned char *buf, unsigned len)
Definition:
bloaty/third_party/zlib/test/infcover.c:463
BSSL_NAMESPACE_BEGIN
Definition:
trust_token_test.cc:45
ErrorTestEventListener
Definition:
gtest_main.h:37
ERR_clear_error
#define ERR_clear_error
Definition:
boringssl_prefix_symbols.h:1413
testing::UnitTest::GetInstance
static UnitTest * GetInstance()
Definition:
bloaty/third_party/googletest/googletest/src/gtest.cc:4616
testing::EmptyTestEventListener
Definition:
bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1141
testing::TestResult::Failed
bool Failed() const
Definition:
bloaty/third_party/googletest/googletest/src/gtest.cc:2207
SetupGoogleTest
void SetupGoogleTest()
Definition:
gtest_main.h:56
ErrorTestEventListener::~ErrorTestEventListener
~ErrorTestEventListener() override
Definition:
gtest_main.h:40
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:00