/* ---------------------------------------------------------------------------- * GTSAM Copyright 2010, Georgia Tech Research Corporation, * Atlanta, Georgia 30332-0415 * All Rights Reserved * Authors: Frank Dellaert, et al. (see THANKS for the full author list) * See LICENSE for the license information * -------------------------------------------------------------------------- */ /** * @file testMethod.cpp * @brief Unit test for GlobalFunction class * @author Frank Dellaert * @date Nov 12, 2014 **/ #include #include #include using namespace std; using namespace wrap; //****************************************************************************** // Constructor TEST( GlobalFunction, Constructor ) { GlobalFunction f; } //****************************************************************************** TEST( GlobalFunction, Grammar ) { using classic::space_p; // Create type grammar that will place result in actual GlobalFunctions actual; vector namespaces; std::string includeFile; GlobalFunctionGrammar g(actual,namespaces,includeFile); // a class type with namespaces EXPECT(parse("Vector aGlobalFunction();", g, space_p).full); EXPECT(parse("Vector overloadedGlobalFunction(int a);", g, space_p).full); EXPECT(parse("Vector overloadedGlobalFunction(int a, double b);", g, space_p).full); LONGS_EQUAL(2,actual.size()); } //****************************************************************************** int main() { TestResult tr; return TestRegistry::runAllTests(tr); } //******************************************************************************