mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 557383: Remove unused variable warning and add extra failure check. r=dholbert
This commit is contained in:
parent
3569ac83b4
commit
286a291a3e
@ -22,14 +22,21 @@
|
||||
|
||||
int main() {
|
||||
std::vector<int> v;
|
||||
int rv = 1;
|
||||
|
||||
TRY {
|
||||
// this should abort; NOT throw an exception
|
||||
int unused = v.at(1);
|
||||
// v.at(1) on empty v should abort; NOT throw an exception
|
||||
|
||||
// (Do some arithmetic with result of v.at() to avoid
|
||||
// compiler warnings for unused variable/result.)
|
||||
rv += v.at(1) ? 1 : 2;
|
||||
} CATCH(const std::out_of_range& e) {
|
||||
fputs("TEST-FAIL | TestSTLWrappers.cpp | caught an exception!\n",
|
||||
fputs("TEST-FAIL | TestSTLWrappers.cpp | caught an exception?\n",
|
||||
stderr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
fputs("TEST-FAIL | TestSTLWrappers.cpp | didn't abort()?\n",
|
||||
stderr);
|
||||
return rv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user