forked from munificent/game-programming-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexpect.h
More file actions
33 lines (28 loc) · 612 Bytes
/
Copy pathexpect.h
File metadata and controls
33 lines (28 loc) · 612 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// expect.h
// gpp
//
// Created by Bob Nystrom on 6/25/13.
// Copyright (c) 2013 Bob Nystrom. All rights reserved.
//
#ifndef gpp_expect_h
#define gpp_expect_h
#define EXPECT(condition) \
expect_(__FILE__, __LINE__, #condition, condition)
static void expect_(const char * file, int line,
const char * expression,
bool condition)
{
using std::cout;
using std::endl;
if (condition)
{
cout << "PASS: " << expression << endl;
}
else
{
cout << "FAIL: " << expression << endl;
cout << " " << file << ":" << line << endl;
}
}
#endif