https://mooseframework.inl.gov
optimization
unit
src
SampleTest.C
Go to the documentation of this file.
1
//* This file is part of the MOOSE framework
2
//* https://mooseframework.inl.gov
3
//*
4
//* All rights reserved, see COPYRIGHT for full restrictions
5
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6
//*
7
//* Licensed under LGPL 2.1, please see LICENSE for details
8
//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10
#include "gtest/gtest.h"
11
12
TEST
(MySampleTests, descriptiveTestName)
13
{
14
// compare equality
15
EXPECT_EQ(2, 1 + 1);
16
EXPECT_DOUBLE_EQ(2 * 3.5, 1.0 * 8 - 1);
17
18
// compare equality and immediately terminate this test if it fails
19
// ASSERT_EQ(2, 1);
20
21
// this won't run if you uncomment the above test because above assert will fail
22
int
n = 0;
23
ASSERT_NO_THROW(n += 3);
24
25
// for a complete list of assertions and for more unit testing documentation see:
26
// https://github.com/google/googletest/blob/master/googletest/docs/Primer.md
27
}
28
29
TEST
(MySampleTests, anotherTest)
30
{
31
EXPECT_LE(1, 2);
32
// ...
33
}
TEST
TEST(MySampleTests, descriptiveTestName)
Definition:
SampleTest.C:12
Generated on Fri Jul 18 2025 13:42:49 for https://mooseframework.inl.gov by
1.8.14