TianoCore EDK2 master
Loading...
Searching...
No Matches
GoogleTestLib.h File Reference
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <cstring>
#include <Uefi.h>

Go to the source code of this file.

Macros

#define EXPECT_THROW_MESSAGE(statement, description)
 
#define ASSERT_THROW_MESSAGE(statement, description)
 

Functions

 ACTION_TEMPLATE (SetArgBuffer, HAS_1_TEMPLATE_PARAMS(size_t, ArgNum),)
 
 MATCHER_P2 (BufferEq, Buffer, ByteSize, std::string("buffer data to ")+(negation ? "not " :"")+"be the same")
 
 MATCHER_P (Char16StrEq, String, std::string("strings to ")+(negation ? "not " :"")+"be the same")
 

Detailed Description

GoogleTestLib class with APIs from the googletest project

Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file GoogleTestLib.h.

Macro Definition Documentation

◆ ASSERT_THROW_MESSAGE

#define ASSERT_THROW_MESSAGE (   statement,
  description 
)
Value:
ASSERT_THAT ( \
[]() { statement; }, \
ThrowsMessage<std::runtime_error>(HasSubstr (description)) \
)

Definition at line 30 of file GoogleTestLib.h.

◆ EXPECT_THROW_MESSAGE

#define EXPECT_THROW_MESSAGE (   statement,
  description 
)
Value:
EXPECT_THAT ( \
[]() { statement; }, \
ThrowsMessage<std::runtime_error>(HasSubstr (description)) \
)

Definition at line 25 of file GoogleTestLib.h.

Function Documentation

◆ ACTION_TEMPLATE()

ACTION_TEMPLATE ( SetArgBuffer  ,
HAS_1_TEMPLATE_PARAMS(size_t, ArgNum)   
)

Definition at line 47 of file GoogleTestLib.h.

◆ MATCHER_P()

MATCHER_P ( Char16StrEq  ,
String  ,
std::string("strings to ")+(negation ? "not " :"")+"be the same"   
)

Definition at line 94 of file GoogleTestLib.h.

◆ MATCHER_P2()

MATCHER_P2 ( BufferEq  ,
Buffer  ,
ByteSize  ,
std::string("buffer data to ")+(negation ? "not " :"")+"be the same"   
)

Definition at line 68 of file GoogleTestLib.h.