Skip to content

TestOther: Shorter test cases#1637

Merged
danmar merged 1 commit into
cppcheck-opensource:masterfrom
rikardfalkeborn:testother-shorter-test-cases
Jan 31, 2019
Merged

TestOther: Shorter test cases#1637
danmar merged 1 commit into
cppcheck-opensource:masterfrom
rikardfalkeborn:testother-shorter-test-cases

Conversation

@rikardfalkeborn
Copy link
Copy Markdown
Contributor

  • Remove newlines after check(
  • Remove unneeded statements after if-statements

As an example, the previous test case

check(
    "bool foo(int x) {\n"
    "  if (x < 0)"
    "    return true;\n"
    "  return false;\n"
    "}");

is changed to

check("void foo(int x) {\n"
      "  if (x < 0) {}\n"
      "}");

* Remove newlines after check(
* Remove unneeded statements after if-statements

As an example, the previous test case

	check(
	    "bool foo(int x) {\n"
	    "  if (x < 0)"
	    "    return true;\n"
	    "  return false;\n"
	    "}");

is changed to

	check("void foo(int x) {\n"
	      "  if (x < 0) {}\n"
	      "}");
@rikardfalkeborn
Copy link
Copy Markdown
Contributor Author

As suggested in #1630. I think the simplest way to review this is to look at the word-diff and ignore white space changes (there's a lot of indentation changes that can be "checked" by running astyle).

@danmar danmar merged commit 91de606 into cppcheck-opensource:master Jan 31, 2019
@rikardfalkeborn rikardfalkeborn deleted the testother-shorter-test-cases branch January 31, 2019 23:21
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.

2 participants