Skip to content

Commit

Permalink
Remove 'error: control reaches end of non-void function' of C++
Browse files Browse the repository at this point in the history
  • Loading branch information
junjihashimoto committed Sep 28, 2023
1 parent 12c2e08 commit dd235d5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions inline-c-cpp/test/tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -298,19 +298,20 @@ main = Hspec.hspec $ do
{- Manual test cases for testing lineDirective and splitTypedC -- For CI, uncomment this line.
Hspec.it "error reporting test case" $ do
result <- try $ [C.throwBlock| int { 0 = 0; /* Test this line. */}|]
result <- try $ [C.throwBlock| int { 0 = 0; return 0xDEADBEEF; /* Test this line. */}|]

Check failure on line 301 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-nightly

error: lvalue required as left operand of assignment

Check failure on line 301 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-lts-21

error: lvalue required as left operand of assignment

Check failure on line 301 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-lts-20

error: lvalue required as left operand of assignment

Check failure on line 301 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-nightly

|

Check failure on line 301 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-lts-21

|

Check failure on line 301 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-lts-20

|
result `shouldBeRight` 0xDEADBEEF
Hspec.it "error reporting test case" $ do
result <- try $ [C.throwBlock| int
{ 1 = 1; /* Test this line. */}
{ 1 = 1; return 0xDEADBEEF; /* Test this line. */}

Check failure on line 306 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-nightly

error: lvalue required as left operand of assignment

Check failure on line 306 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-lts-21

error: lvalue required as left operand of assignment

Check failure on line 306 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-lts-20

error: lvalue required as left operand of assignment

Check failure on line 306 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-nightly

error: expression is not assignable

Check failure on line 306 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-lts-21

error: expression is not assignable

Check failure on line 306 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-lts-20

error: expression is not assignable
|]
result `shouldBeRight` 0xDEADBEEF
Hspec.it "error reporting test case" $ do
result <- try $ [C.throwBlock| int
{
2 = 2; /* Test this line. */
2 = 2; /* Test this line. */

Check failure on line 313 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-nightly

error: lvalue required as left operand of assignment

Check failure on line 313 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-lts-21

error: lvalue required as left operand of assignment

Check failure on line 313 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-lts-20

error: lvalue required as left operand of assignment

Check failure on line 313 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-nightly

error: expression is not assignable

Check failure on line 313 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-lts-21

error: expression is not assignable

Check failure on line 313 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-lts-20

error: expression is not assignable
return 0xDEADBEEF;
}
|]
result `shouldBeRight` 0xDEADBEEF
Expand All @@ -320,6 +321,7 @@ main = Hspec.hspec $ do
int
{
3 = 3; /* Test this line. */

Check failure on line 323 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-nightly

error: lvalue required as left operand of assignment

Check failure on line 323 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-lts-21

error: lvalue required as left operand of assignment

Check failure on line 323 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-lts-20

error: lvalue required as left operand of assignment

Check failure on line 323 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-nightly

error: expression is not assignable

Check failure on line 323 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-lts-21

error: expression is not assignable

Check failure on line 323 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-lts-20

error: expression is not assignable
return 0xDEADBEEF;
}
|]
result `shouldBeRight` 0xDEADBEEF
Expand All @@ -330,6 +332,7 @@ main = Hspec.hspec $ do
int
{
4 = 4; /* Test this line. */

Check failure on line 334 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-nightly

error: lvalue required as left operand of assignment

Check failure on line 334 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-lts-21

error: lvalue required as left operand of assignment

Check failure on line 334 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest-stack-lts-20

error: lvalue required as left operand of assignment

Check failure on line 334 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-nightly

error: expression is not assignable

Check failure on line 334 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-lts-21

error: expression is not assignable

Check failure on line 334 in inline-c-cpp/test/tests.hs

View workflow job for this annotation

GitHub Actions / macos-latest-stack-lts-20

error: expression is not assignable
return 0xDEADBEEF;
}
|]
result `shouldBeRight` 0xDEADBEEF
Expand Down

0 comments on commit dd235d5

Please sign in to comment.