Skip to content

Amend NameAndTypeResolution expected messages#2624

Merged
axic merged 1 commit intoargotorg:developfrom
izgzhen:amend-test-msg
Aug 11, 2017
Merged

Amend NameAndTypeResolution expected messages#2624
axic merged 1 commit intoargotorg:developfrom
izgzhen:amend-test-msg

Conversation

@izgzhen
Copy link
Contributor

@izgzhen izgzhen commented Jul 24, 2017

Fixes #2613.

@axic
Copy link
Contributor

axic commented Jul 24, 2017

Thanks! A few tests fail, see here for a list: https://travis-ci.org/ethereum/solidity/jobs/256799732

@axic
Copy link
Contributor

axic commented Jul 24, 2017

Oh I see the probable reason. @izgzhen these aren't messages displayed to the user during testing, but the messages the compiler emits when compiling those code snippets. Our tests need to ensure we check that the right message was emitted by the compiler.

@izgzhen
Copy link
Contributor Author

izgzhen commented Jul 24, 2017

Right ... so I think another half of the work is still missing right?

@izgzhen
Copy link
Contributor Author

izgzhen commented Jul 24, 2017

If so, although not quite the "up-for-grab" level, I'll give a try to some of them at least 😆

@chriseth
Copy link
Contributor

@izgzhen so the idea is that you copy-paste the source code into a file, run solc on the file, check that there is exactly one error message and just copy the error message into the test file. If you want to verify, run soltest -- --no-ipc.

@izgzhen
Copy link
Contributor Author

izgzhen commented Jul 30, 2017

Fixed, and for some cases, I found that no matter what I filled in, it is always okay (I filled in "x")

@axic
Copy link
Contributor

axic commented Aug 1, 2017

for some cases, I found that no matter what I filled in, it is always okay (I filled in "x")

Are you sure the message doesn't contain a single letter x in those cases?

It tries a text submatch.

@izgzhen
Copy link
Contributor Author

izgzhen commented Aug 1, 2017

Are you sure the message doesn't contain a single letter x in those cases?
It tries a text submatch.

Well, it is interesting .. I'll try it again. Thanks!

@izgzhen
Copy link
Contributor Author

izgzhen commented Aug 1, 2017

@axic Fixed, sorry that I was a bit busy these days thus I didn't carefully go through the existing code before diving into it. Thanks a lot for your patience

@axic
Copy link
Contributor

axic commented Aug 1, 2017

Thanks! Is this still partially solving #2613 or does it change every message?

@izgzhen
Copy link
Contributor Author

izgzhen commented Aug 1, 2017

Thanks! Is this still partially solving #2613 or does it change every message?

Every originally "" msg that I can find.

@axic axic requested a review from chriseth August 1, 2017 13:36
@axic
Copy link
Contributor

axic commented Aug 1, 2017

Looks good to me.

@axic
Copy link
Contributor

axic commented Aug 3, 2017

@chriseth please double check, but would be nice to merge soon

// Error: Identifier already declared.
// Error: Override changes function to modifier.
CHECK_ERROR_ALLOW_MULTI(text, DeclarationError, "");
CHECK_ERROR_ALLOW_MULTI(text, DeclarationError, "Identifier already declared.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the real test case here is "Override changes function to modifier.".

// Error: Identifier already declared.
// Error: Override changes modifier to function.
CHECK_ERROR_ALLOW_MULTI(text, DeclarationError, "Identifier already declared");
CHECK_ERROR_ALLOW_MULTI(text, DeclarationError, "Identifier already declared.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the real test case here is "Override changes modifier to function."

}
)";
CHECK_ERROR_ALLOW_MULTI(text, DeclarationError, "");
CHECK_ERROR_ALLOW_MULTI(text, DeclarationError, "Function with same name and arguments defined twice.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The real test case here is "Only one fallback function is allowed."

@axic
Copy link
Contributor

axic commented Aug 9, 2017

@izgzhen sorry it took so long, but could you change the above three things? I'd like to get this merged asap.

@axic axic changed the title Amend test msg Amend NameAndTypeResolution expected messages Aug 10, 2017
@izgzhen
Copy link
Contributor Author

izgzhen commented Aug 11, 2017

@izgzhen sorry it took so long, but could you change the above three things? I'd like to get this merged asap.

It is okay :) I've updated the code, hoping it works.

@axic
Copy link
Contributor

axic commented Aug 11, 2017

Thanks!

Seems like we need to improve our testing infrastructure to handle those properly, because it always takes the first error:

Expected message "Override changes function to modifier." but found "Identifier already declared.".
/home/travis/build/ethereum/solidity/test/libsolidity/SolidityNameAndTypeResolution.cpp(1120): error in "modifier_overrides_function": check searchErrorMessage(err, ("Override changes function to modifier.")) failed
Expected message "Override changes function to modifier." but found "Identifier already declared.".
/home/travis/build/ethereum/solidity/test/libsolidity/SolidityNameAndTypeResolution.cpp(1131): error in "function_overrides_modifier": check searchErrorMessage(err, ("Override changes function to modifier.")) failed
Expected message "Only one fallback function is allowed." but found "Function with same name and arguments defined twice.".
/home/travis/build/ethereum/solidity/test/libsolidity/SolidityNameAndTypeResolution.cpp(1369): error in "fallback_function_twice": check searchErrorMessage(err, ("Only one fallback function is allowed.")) failed

Can you just revert those 3 to what you had and I'll address it in a separate PR?

@axic
Copy link
Contributor

axic commented Aug 11, 2017

@izgzhen realised I can push to your branch and did the changes myself

@axic axic merged commit 92b535f into argotorg:develop Aug 11, 2017
@axic axic removed the nextrelease label Aug 11, 2017
@axic
Copy link
Contributor

axic commented Aug 11, 2017

@izgzhen thanks!

@axic axic self-assigned this Aug 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants