proxygen
PortabilityTest.cpp File Reference
#include <folly/Portability.h>
#include <memory>
#include <folly/portability/GTest.h>

Go to the source code of this file.

Classes

class  Base
 
class  Derived
 

Functions

int fooBase (const Base *p)
 
int fooDerived (const Derived *p)
 
 TEST (Portability, Final)
 

Function Documentation

int fooBase ( const Base p)

Definition at line 45 of file PortabilityTest.cpp.

Referenced by TEST().

45  {
46  return p->foo() + 1;
47 }
int fooDerived ( const Derived p)

Definition at line 48 of file PortabilityTest.cpp.

Referenced by TEST().

48  {
49  return p->foo() + 1;
50 }
TEST ( Portability  ,
Final   
)

Definition at line 52 of file PortabilityTest.cpp.

References EXPECT_EQ, fooBase(), and fooDerived().

52  {
53  std::unique_ptr<Derived> p(new Derived);
54  EXPECT_EQ(3, fooBase(p.get()));
55  EXPECT_EQ(3, fooDerived(p.get()));
56 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
int fooDerived(const Derived *p)
int fooBase(const Base *p)