From dbc6a8aeec6847db45c9f73d90c9413307b6c031 Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Thu, 15 Dec 2011 19:39:09 +0000 Subject: [PATCH] Reverted wrap argument change due to failing tests --- wrap/Argument.cpp | 18 +++++++++++------- wrap/tests/testWrap.cpp | 16 +++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/wrap/Argument.cpp b/wrap/Argument.cpp index 329f0a643..0c82bfc7f 100644 --- a/wrap/Argument.cpp +++ b/wrap/Argument.cpp @@ -70,19 +70,23 @@ string ArgumentList::types() const { /* ************************************************************************* */ string ArgumentList::signature() const { - string str; + string sig; BOOST_FOREACH(Argument arg, *this) { - BOOST_FOREACH(char ch, arg.type) - if(isupper(ch)) - str += ch; + // original + sig += arg.type[0]; - if(str.length() == 0) - str += arg.type[0]; + // version to disambiguate +// if(sig.length() == 0) +// sig += arg.type[0]; +// +// BOOST_FOREACH(char ch, arg.type) +// if(isupper(ch)) +// sig += ch; } - return str; + return sig; } /* ************************************************************************* */ diff --git a/wrap/tests/testWrap.cpp b/wrap/tests/testWrap.cpp index d4277533a..2ddc2925a 100644 --- a/wrap/tests/testWrap.cpp +++ b/wrap/tests/testWrap.cpp @@ -36,13 +36,15 @@ static string topdir = "TOPSRCDIR_NOT_CONFIGURED"; // If TOPSRCDIR is not define /* ************************************************************************* */ TEST( wrap, ArgumentList ) { ArgumentList args; - Argument arg; arg.type = "double"; arg.name = "x"; - args.push_back(arg); - args.push_back(arg); - args.push_back(arg); - CHECK(args.signature()=="ddd"); - EXPECT(args.types()=="double,double,double"); - EXPECT(args.names()=="x,x,x"); + Argument arg1; arg1.type = "double"; arg1.name = "x"; + Argument arg2; arg2.type = "double"; arg2.name = "y"; + Argument arg3; arg3.type = "double"; arg3.name = "z"; + args.push_back(arg1); + args.push_back(arg2); + args.push_back(arg3); + EXPECT(assert_equal("ddd", args.signature())); + EXPECT(assert_equal("double,double,double", args.types())); + EXPECT(assert_equal("x,y,z", args.names())); } /* ************************************************************************* */