Skip to content

Commit

Permalink
test for printing non-existent variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Bernauer committed Aug 30, 2012
1 parent e090bf0 commit 77691ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ruab/src/Ruab/Backend/GDB.hs
Expand Up @@ -69,7 +69,7 @@ evaluate_expression ctx expr = do
G.RCError -> maybe
($abort ("unexpected response: " ++ show resp))
(return . Left)
(convert G.response_error resp)
((G.response_error . G.respResults) resp)

_ -> $abort $ "unexpected response: " ++ show resp

Expand Down
15 changes: 13 additions & 2 deletions ruab/src/Ruab/Core/Test.hs
Expand Up @@ -176,7 +176,7 @@ test_integration = enumTestGroup "integration" $ map runTest [
, ExpectResponse (Right ResShutdown) Nothing
, ExpectStatus [isShutdown] Nothing
]
-- print local variable of non-critical function
-- print local variable of non-critical function {{{3
, [ ExpectStart $ CmdAddBreakpoint (PRow 461) []
, ExpectStatus [isWaiting] Nothing
, ExpectResponse (Right (ResAddBreakpoint (UserBreakpoint 1 (PRow 461) [0, 1, 2]))) (Just CmdRun)
Expand All @@ -191,6 +191,17 @@ test_integration = enumTestGroup "integration" $ map runTest [
, ExpectResponse (Right ResShutdown) Nothing
, ExpectStatus [isShutdown] Nothing
]
-- print non-existent local variable of non-critical function {{{3
, [ ExpectStart $ CmdAddBreakpoint (PRow 461) []
, ExpectStatus [isWaiting] Nothing
, ExpectResponse (Right (ResAddBreakpoint (UserBreakpoint 1 (PRow 461) [0, 1, 2]))) (Just CmdRun)
, ExpectResponse (Right ResRun) Nothing
, ExpectStatus [isRunning] Nothing
, ExpectStatus [isStopped, threadStopped 2 1 461] (Just (CmdEvaluate "j"))
, ExpectResponse (Left "No symbol \"j\" in current context.") (Just CmdShutdown)
, ExpectResponse (Right ResShutdown) Nothing
, ExpectStatus [isShutdown] Nothing
]

-- end {{{3
]
Expand Down Expand Up @@ -237,7 +248,7 @@ test_integration = enumTestGroup "integration" $ map runTest [
fail ""

step actor fCommand input (count, (expected:rest)) = do
putStrLn $ printf "%.2d: %s" count (show input)
-- putStrLn $ printf "%.2d: %s" count (show input)
cmd <- handle input expected
when (isJust cmd) (fCommand (fromJust cmd))
when (null rest) (quit actor)
Expand Down

0 comments on commit 77691ca

Please sign in to comment.