Cody

Problem 42396. the proud tradition of zero scores in Cody

Solution 691044

Submitted on 24 Jun 2015 by Binbin Qi
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Fail
%% % removes overloads addressing this specific testsuite !/bin/rm assert* fopen* fclose* fread* % gets expected output/score fh=fopen('zeroscore.m');str=fread(fh,'*char')'; fclose(fh); results=cody.verifyCode(str,'assert(isequal(zeroscore(),0))'); % pass/fail str={'Failed','Passed'}; if results.pass&results.score=='0'&ischar(results.score), fprintf('Congrats! Solution score: %s; Correct output: %s\n',results.score, str{1+results.pass}); else fprintf('Sorry! Solution score: %s; Correct output: %s\n',results.score, str{1+results.pass}); [a,b]=1; end

[Warning: Directory already exists.] [> In length (line 2) In checkAttrs', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/lang/+matlab/+internal/+validators/attributes.p', 40)" style="font-weight:bold">matlab.internal.validators.attributes>checkAttrs (line 40) In matlab.internal.validators.attributes (line 20) In matlab.unittest.internal.Loggable/log (line 74) In prepareToRunTestContent', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/testframework/+matlab/+unittest/+internal/ScriptTestCaseProvider.m', 94)" style="font-weight:bold">matlab.unittest.internal.ScriptTestCaseProvider>prepareToRunTestContent (line 94) In runSharedVariableSection', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/testframework/+matlab/+unittest/+internal/ScriptTestCaseProvider.m', 80)" style="font-weight:bold">matlab.unittest.internal.ScriptTestCaseProvider>runSharedVariableSection (line 80) In @(testCase)runSharedVariableSection(testCase,provider.SharedVariableCode)', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/testframework/+matlab/+unittest/+internal/ScriptTestCaseProvider.m', 74)" style="font-weight:bold">matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)runSharedVariableSection(testCase,provider.SharedVariableCode) (line 74) In matlab.unittest.FunctionTestCase/setupOnce (line 74) In matlab.unittest.TestRunner/evaluateMethodCore (line 920) In matlab.unittest.TestRunner/evaluateMethod (line 1139) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 943) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 596) In cody.CodyPlugin/evaluateMethod (line 53) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 624) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 808) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 868) In matlab.unittest.TestRunner/setupTestClass (line 1069) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 943) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 808) In matlab.unittest.TestRunner/prepareTestClass (line 613) In matlab.unittest.TestRunner/runSharedTestCase (line 451) In matlab.unittest.TestRunner/runTestClass (line 1048) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 943) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 808) In matlab.unittest.TestRunner/runTestSuite (line 996) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 943) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 227) In cody.CodyPlugin/runTestSuite (line 35) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 624) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 808) In matlab.unittest.TestRunner/run (line 297) In cody.verifyCode>runTestSuite (line 129) In cody.verifyCode (line 71) In mls.internal.fevalJSON (line 14)] ans = 0 [Warning: Directory already exists.] [> In length (line 2) In checkAttrs', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/lang/+matlab/+internal/+validators/attributes.p', 40)" style="font-weight:bold">matlab.internal.validators.attributes>checkAttrs (line 40) In matlab.internal.validators.attributes (line 20) In matlab.unittest.internal.Loggable/log (line 84) In prepareToRunTestContent', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/testframework/+matlab/+unittest/+internal/ScriptTestCaseProvider.m', 94)" style="font-weight:bold">matlab.unittest.internal.ScriptTestCaseProvider>prepareToRunTestContent (line 94) In runSharedVariableSection', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/testframework/+matlab/+unittest/+internal/ScriptTestCaseProvider.m', 80)" style="font-weight:bold">matlab.unittest.internal.ScriptTestCaseProvider>runSharedVariableSection (line 80) In @(testCase)runSharedVariableSection(testCase,provider.SharedVariableCode)', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/testframework/+matlab/+unittest/+internal/ScriptTestCaseProvider.m', 74)" style="font-weight:bold">matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)runSharedVariableSection(testCase,provider.SharedVariableCode) (line 74) In matlab.unittest.FunctionTestCase/setupOnce (line 74) In matlab.unittest.TestRunner/evaluateMethodCore (line 920) In matlab.unittest.TestRunner/evaluateMethod (line 1139) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 943) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 596) In cody.CodyPlugin/evaluateMethod (line 53) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 624) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 808) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 868) In matlab.unittest.TestRunner/setupTestClass (line 1069) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 943) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 808) In matlab.unittest.TestRunner/prepareTestClass (line 613) In matlab.unittest.TestRunner/runSharedTestCase (line 451) In matlab.unittest.TestRunner/runTestClass (line 1048) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 943) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 808) In matlab.unittest.TestRunner/runTestSuite (line 996) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 943) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 227) In cody.CodyPlugin/runTestSuite (line 35) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 624) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 808) In matlab.unittest.TestRunner/run (line 297) In cody.verifyCode>runTestSuite (line 129) In cody.verifyCode (line 71) In mls.internal.fevalJSON (line 14)] ans = 0 [Warning: Directory already exists.] ans = 0 [Warning: Directory already exists.] ans = 0 [Warning: Directory already exists.] [> In length (line 2) In checkAttrs', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/lang/+matlab/+internal/+validators/attributes.p', 40)" style="font-weight:bold">matlab.internal.validators.attributes>checkAttrs (line 40) In matlab.internal.validators.attributes (line 20) In matlab.unittest.internal.Loggable/log (line 74) In prepareToRunTestContent', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/testframework/+matlab/+unittest/+internal/ScriptTestCaseProvider.m', 94)" style="font-weight:bold">matlab.unittest.internal.ScriptTestCaseProvider>prepareToRunTestContent (line 94) In runTest', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/testframework/+matlab/+unittest/+internal/ScriptTestCaseProvider.m', 86)" style="font-weight:bold">matlab.unittest.internal.ScriptTestCaseProvider>runTest (line 86) In @(testCase)runTest(testCase,provider.TestCode)', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/testframework/+matlab/+unittest/+internal/ScriptTestCaseProvider.m', 73)" style="font-weight:bold">matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)runTest(testCase,provider.TestCode) (line 73) In matlab.unittest.FunctionTestCase/test (line 98) In matlab.unittest.TestRunner/evaluateMethodCore (line 920) In matlab.unittest.TestRunner/evaluateMethod (line 1139) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 943) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 596) In cody.CodyPlugin/evaluateMethod (line 53) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 624) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 808) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 868) In matlab.unittest.TestRunner/runTestMethod (line 1135) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 943) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 586) In cody.CodyPlugin/runTestMethod (line 21) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 624) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 808) In matlab.unittest.TestRunner/runTest (line 1101) In matlab.unittest.TestRunner/runSharedTestCase (line 472) In matlab.unittest.TestRunner/runTestClass (line 1048) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 943) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 808) In matlab.unittest.TestRunner/runTestSuite (line 996) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 943) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 227) In cody.CodyPlugin/runTestSuite (line 35) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 624) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 808) In matlab.unittest.TestRunner/run (line 297) In cody.verifyCode>runTestSuite (line 129) In cody.verifyCode (line 71) In mls.internal.fevalJSON (line 14)] ans = 0 [Warning: Directory already exists.] [> In length (line 2) In checkAttrs', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/lang/+matlab/+internal/+validators/attributes.p', 40)" style="font-weight:bold">matlab.internal.validators.attributes>checkAttrs (line 40) In matlab.internal.validators.attributes (line 20) In matlab.unittest.internal.Loggable/log (line 84) In prepareToRunTestContent', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/testframework/+matlab/+unittest/+internal/ScriptTestCaseProvider.m', 94)" style="font-weight:bold">matlab.unittest.internal.ScriptTestCaseProvider>prepareToRunTestContent (line 94) In runTest', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/testframework/+matlab/+unittest/+internal/ScriptTestCaseProvider.m', 86)" style="font-weight:bold">matlab.unittest.internal.ScriptTestCaseProvider>runTest (line 86) In @(testCase)runTest(testCase,provider.TestCode)', '/opt/mlsedu/matlab/R2015a/toolbox/matlab/testframework/+matlab/+unittest/+internal/ScriptTestCaseProvider.m'...

Invalid file identifier. Use fopen to generate a valid file identifier.

Suggested Problems

More from this Author38

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!