testSymbol.cpp
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
12 /*
13  * @file testSymbol.cpp
14  * @author Frank Dellaert
15  */
16 
17 #include <gtsam/inference/Symbol.h>
18 
20 
21 using namespace std;
22 using namespace gtsam;
23 
24 /* ************************************************************************* */
25 // A custom (nonsensical) formatter.
27  return "special";
28 }
29 
30 TEST(Symbol, Formatting) {
31  Symbol symbol('c', 3);
32 
33  // use key_formatter with a function pointer
34  stringstream ss2;
36  EXPECT("special" == ss2.str());
37 
38  // use key_formatter with a function object.
39  stringstream ss3;
41  EXPECT("c3" == ss3.str());
42 }
43 
44 /* ************************************************************************* */
45 int main() {
46  TestResult tr;
47  return TestRegistry::runAllTests(tr);
48 }
49 /* ************************************************************************* */
50 
TEST(Symbol, Formatting)
Definition: testSymbol.cpp:30
static int runAllTests(TestResult &result)
Definition: Half.h:150
string symbolMyFormatter(Key key)
Definition: testSymbol.cpp:26
#define EXPECT(condition)
Definition: Test.h:151
Key symbol(unsigned char c, std::uint64_t j)
traits
Definition: chartTesting.h:28
int main()
Definition: testSymbol.cpp:45
static const gtsam::KeyFormatter MultiRobotKeyFormatter
Definition: Key.h:54
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:61


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:49:57