proxygen
TestUtils.h File Reference

Go to the source code of this file.

Macros

#define EXPECT_DEATH_NO_CORE(token, regex)
 

Functions

folly::StringPiece getContainingDirectory (folly::StringPiece input)
 

Macro Definition Documentation

#define EXPECT_DEATH_NO_CORE (   token,
  regex 
)
Value:
{ \
rlimit oldLim; \
getrlimit(RLIMIT_CORE, &oldLim); \
rlimit newLim{0, oldLim.rlim_max}; \
setrlimit(RLIMIT_CORE, &newLim); \
EXPECT_DEATH(token, regex); \
setrlimit(RLIMIT_CORE, &oldLim); \
}
regex
Definition: CMakeCache.txt:563

Definition at line 19 of file TestUtils.h.

Referenced by HTTP2FramerTest::dataFrameTest(), TEST(), and TEST_F().

Function Documentation

folly::StringPiece getContainingDirectory ( folly::StringPiece  input)
inline

Definition at line 33 of file TestUtils.h.

References folly::rfind(), and folly::Range< Iter >::subpiece().

33  {
34  auto pos = folly::rfind(input, '/');
35  if (pos == std::string::npos) {
36  pos = 0;
37  } else {
38  pos += 1;
39  }
40  return input.subpiece(0, pos);
41 }
size_t rfind(const Range< Iter > &haystack, const typename Range< Iter >::value_type &needle)
Definition: Range.h:1404
Range subpiece(size_type first, size_type length=npos) const
Definition: Range.h:686