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 #include <sstream>
22 
23 using namespace std;
24 using namespace gtsam;
25 
26 /* ************************************************************************* */
27 // A custom (nonsensical) formatter.
29  return "special";
30 }
31 
32 TEST(Symbol, Formatting) {
33  Symbol symbol('c', 3);
34 
35  // use key_formatter with a function pointer
36  stringstream ss2;
38  EXPECT("special" == ss2.str());
39 
40  // use key_formatter with a function object.
41  stringstream ss3;
43  EXPECT("c3" == ss3.str());
44 }
45 
46 /* ************************************************************************* */
47 int main() {
48  TestResult tr;
49  return TestRegistry::runAllTests(tr);
50 }
51 /* ************************************************************************* */
52 
const gtsam::Symbol key('X', 0)
TEST(Symbol, Formatting)
Definition: testSymbol.cpp:32
static int runAllTests(TestResult &result)
Definition: BFloat16.h:88
string symbolMyFormatter(Key key)
Definition: testSymbol.cpp:28
#define EXPECT(condition)
Definition: Test.h:150
Key symbol(unsigned char c, std::uint64_t j)
traits
Definition: chartTesting.h:28
int main()
Definition: testSymbol.cpp:47
static const gtsam::KeyFormatter MultiRobotKeyFormatter
Definition: Key.h:54
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:39:43