File: assert-test.cc

package info (click to toggle)
fmtlib 5.2.1%2Bds-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 1,268 kB
  • sloc: cpp: 10,611; ansic: 348; python: 88; sh: 13; makefile: 10
file content (22 lines) | stat: -rw-r--r-- 602 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Formatting library for C++ - assertion tests
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.

#include "fmt/core.h"
#include <gtest/gtest.h>

#if GTEST_HAS_DEATH_TEST
# define EXPECT_DEBUG_DEATH_IF_SUPPORTED(statement, regex) \
    EXPECT_DEBUG_DEATH(statement, regex)
#else
# define EXPECT_DEBUG_DEATH_IF_SUPPORTED(statement, regex) \
    GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, )
#endif

TEST(AssertTest, Fail) {
  EXPECT_DEBUG_DEATH_IF_SUPPORTED(
      FMT_ASSERT(false, "don't panic!"), "don't panic!");
}