Reverted wrap argument change due to failing tests

release/4.3a0
Alex Cunningham 2011-12-15 19:39:09 +00:00
parent 99338805c0
commit dbc6a8aeec
2 changed files with 20 additions and 14 deletions

View File

@ -70,19 +70,23 @@ string ArgumentList::types() const {
/* ************************************************************************* */ /* ************************************************************************* */
string ArgumentList::signature() const { string ArgumentList::signature() const {
string str; string sig;
BOOST_FOREACH(Argument arg, *this) BOOST_FOREACH(Argument arg, *this)
{ {
BOOST_FOREACH(char ch, arg.type) // original
if(isupper(ch)) sig += arg.type[0];
str += ch;
if(str.length() == 0) // version to disambiguate
str += arg.type[0]; // if(sig.length() == 0)
// sig += arg.type[0];
//
// BOOST_FOREACH(char ch, arg.type)
// if(isupper(ch))
// sig += ch;
} }
return str; return sig;
} }
/* ************************************************************************* */ /* ************************************************************************* */

View File

@ -36,13 +36,15 @@ static string topdir = "TOPSRCDIR_NOT_CONFIGURED"; // If TOPSRCDIR is not define
/* ************************************************************************* */ /* ************************************************************************* */
TEST( wrap, ArgumentList ) { TEST( wrap, ArgumentList ) {
ArgumentList args; ArgumentList args;
Argument arg; arg.type = "double"; arg.name = "x"; Argument arg1; arg1.type = "double"; arg1.name = "x";
args.push_back(arg); Argument arg2; arg2.type = "double"; arg2.name = "y";
args.push_back(arg); Argument arg3; arg3.type = "double"; arg3.name = "z";
args.push_back(arg); args.push_back(arg1);
CHECK(args.signature()=="ddd"); args.push_back(arg2);
EXPECT(args.types()=="double,double,double"); args.push_back(arg3);
EXPECT(args.names()=="x,x,x"); EXPECT(assert_equal("ddd", args.signature()));
EXPECT(assert_equal("double,double,double", args.types()));
EXPECT(assert_equal("x,y,z", args.names()));
} }
/* ************************************************************************* */ /* ************************************************************************* */