WPILibC++
2020.3.2
Utility.h
1
/*----------------------------------------------------------------------------*/
2
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
3
/* Open Source Software - may be modified and shared by FRC teams. The code */
4
/* must be accompanied by the FIRST BSD license file in the root directory of */
5
/* the project. */
6
/*----------------------------------------------------------------------------*/
7
8
#pragma once
9
14
#include <stdint.h>
15
16
#include <string>
17
18
#include <wpi/StringRef.h>
19
#include <wpi/Twine.h>
20
#include <wpi/deprecated.h>
21
22
#define wpi_assert(condition) \
23
wpi_assert_impl(condition, #condition, "", __FILE__, __LINE__, __FUNCTION__)
24
#define wpi_assertWithMessage(condition, message) \
25
wpi_assert_impl(condition, #condition, message, __FILE__, __LINE__, \
26
__FUNCTION__)
27
28
#define wpi_assertEqual(a, b) \
29
wpi_assertEqual_impl(a, b, #a, #b, "", __FILE__, __LINE__, __FUNCTION__)
30
#define wpi_assertEqualWithMessage(a, b, message) \
31
wpi_assertEqual_impl(a, b, #a, #b, message, __FILE__, __LINE__, __FUNCTION__)
32
33
#define wpi_assertNotEqual(a, b) \
34
wpi_assertNotEqual_impl(a, b, #a, #b, "", __FILE__, __LINE__, __FUNCTION__)
35
#define wpi_assertNotEqualWithMessage(a, b, message) \
36
wpi_assertNotEqual_impl(a, b, #a, #b, message, __FILE__, __LINE__, \
37
__FUNCTION__)
38
45
bool
wpi_assert_impl(
bool
conditionValue,
const
wpi::Twine
& conditionText,
46
const
wpi::Twine
& message,
wpi::StringRef
fileName,
47
int
lineNumber,
wpi::StringRef
funcName);
48
56
bool
wpi_assertEqual_impl(
int
valueA,
int
valueB,
57
const
wpi::Twine
& valueAString,
58
const
wpi::Twine
& valueBString,
59
const
wpi::Twine
& message,
wpi::StringRef
fileName,
60
int
lineNumber,
wpi::StringRef
funcName);
61
69
bool
wpi_assertNotEqual_impl(
int
valueA,
int
valueB,
70
const
wpi::Twine
& valueAString,
71
const
wpi::Twine
& valueBString,
72
const
wpi::Twine
& message,
wpi::StringRef
fileName,
73
int
lineNumber,
wpi::StringRef
funcName);
wpi::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:
StringRef.h:49
wpi::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition:
Twine.h:85
wpilibc
src
main
native
include
frc
Utility.h
Generated on Fri Feb 21 2020 08:50:36 for WPILibC++ by
1.8.16