Skip to content

Commit e93a057

Browse files
committed
🆕 [example] GAssert example
Problem: - There are no examples for ASSERT/EXPECT. Solution: - Add GAssert examples.
1 parent 2265dad commit e93a057

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ else()
7272
endfunction()
7373
endif()
7474

75+
test(example/GAssert SCENARIO=)
7576
test(example/GMock SCENARIO=)
7677
test(example/GTest SCENARIO=)
7778
test(example/GTest-Lite SCENARIO=)

example/GAssert.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// Copyright (c) 2016-2017 Kris Jusiak (kris at jusiak dot net)
3+
//
4+
// Distributed under the Boost Software License, Version 1.0.
5+
// (See accompanying file LICENSE_1_0.txt or copy at
6+
// http://www.boost.org/LICENSE_1_0.txt)
7+
//
8+
#include "GUnit/GAssert.h"
9+
10+
int main() {
11+
EXPECT(true);
12+
13+
const auto i = 42;
14+
EXPECT(42 == i);
15+
16+
ASSERT(42.0 == 42.);
17+
}

include/GUnit/GSteps.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ class Steps : public ::testing::EmptyTestEventListener {
388388
return Step<-1, true>{*this, {"Then", File::c_str(), line}, pattern};
389389
}
390390

391-
// clang-format off
391+
// clang-format off
392392
#if defined(__clang__)
393393
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
394394
#endif

0 commit comments

Comments
 (0)