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 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;
}
/* ************************************************************************* */

View File

@ -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()));
}
/* ************************************************************************* */