Skip to content

Commit

Permalink
Fix code warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
eszmw committed Aug 25, 2023
1 parent b63d364 commit c319524
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 21 deletions.
Binary file modified Scripts/CalculateWork.mlx
Binary file not shown.
Binary file modified Scripts/SecondLaw.mlx
Binary file not shown.
Binary file modified Scripts/SetUpCoolProp.mlx
Binary file not shown.
12 changes: 5 additions & 7 deletions Utilities/OpenREADME.m
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
function OpenREADME

try
proj = currentProject;

curFile = matlab.desktop.editor.getActive;
if isMATLABReleaseOlderThan("R2023b")
open("README2.mlx")
else
open("README.mlx")
currentProject;
catch
openProject;
end
curFile = matlab.desktop.editor.getActive;
open("README.mlx")
navFile = matlab.desktop.editor.getActive;
if string(curFile.Filename) ~= string(navFile.Filename)
close(curFile)
Expand Down
2 changes: 1 addition & 1 deletion Utilities/StartUpFcn.m
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function OtherButtonPushed(app, event)
end

% Button pushed function: ReviewUsButton
function ReviewUsButtonPushed(app, event)
function ReviewUsButtonPushed(app)
app.TabGroup.SelectedTab = app.TabReview;
end

Expand Down
2 changes: 1 addition & 1 deletion Utilities/runMyTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
runner = matlab.unittest.TestRunner.withTextOutput;
runner.addPlugin(TestReportPlugin.producingHTML('Verbosity',3))

results = runner.run(testsuite("tests"))
results = runner.run(testsuite("tests")) %#ok<*NOPTS>

T = table(results)

Expand Down
5 changes: 2 additions & 3 deletions buildutil/codecheckModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ function codecheckModule(rootDir)
error("thermodynamics:codeissues","No files to check.")
end

if verLessThan('matlab','9.13')
% Use the old check code before R2022b
if isMATLABReleaseOlderThan("R2022b")
issues = checkcode(filesToCheck);
issues = [issues{:}];
issueCount = size(issues,1);
Expand All @@ -38,7 +37,7 @@ function codecheckModule(rootDir)
writeBadgeJSONFile("code issues",string(issueCount), color)

if issueCount ~= 0
if verLessThan('matlab','9.13')
if isMATLABReleaseOlderThan("R2022b")
% pre R2022b, run checkcode without a RHS argument to display issues
checkcode(filesToCheck)
else
Expand Down
4 changes: 2 additions & 2 deletions buildutil/testModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function testModule(options)
import matlab.unittest.plugins.XMLPlugin;
% import matlab.unittest.selectors.HasTag;

oldpath = addpath("tests",genpath(extractBefore(pwd,"buildutil")));
oldpath = addpath("SoftwareTests",genpath(extractBefore(pwd,"buildutil")));
finalize = onCleanup(@()(path(oldpath)));
openProject(options.ModuleName);

Expand All @@ -33,7 +33,7 @@ function testModule(options)

if options.RunSmokeTests
smokeResults = runner.run(smokeSuite);
if ~verLessThan('matlab','9.9') && ~isMATLABReleaseOlderThan("R2022a")
if ~isMATLABReleaseOlderThan("R2022a")
% This report is only available in R2022a and later.
% isMATLABReleaseOlderThan wasn't added until MATLAB 2020b / version 9.9
smokeResults.generateHTMLReport(outputDirectory,'MainFile',"testreport.html");
Expand Down
11 changes: 4 additions & 7 deletions report/test-results.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<testsuites>
<testsuite errors="0" failures="0" name="smokeTests" skipped="0" tests="6" time="475.0249">
<testcase classname="smokeTests" name="runCalculateWork" time="61.6547"/>
<testcase classname="smokeTests" name="runCreatePVplots" time="0.33754"/>
<testcase classname="smokeTests" name="runFirstLaw" time="1.402"/>
<testcase classname="smokeTests" name="runSecondLaw" time="83.1587"/>
<testcase classname="smokeTests" name="runStatePlots" time="0.79802"/>
<testcase classname="smokeTests" name="runBuildFridge" time="327.674"/>
<testsuite errors="0" failures="0" name="functionTests" skipped="0" tests="3" time="0.039267">
<testcase classname="functionTests" name="checkGetBoundsSingle" time="0.02169"/>
<testcase classname="functionTests" name="checkGetBoundsVector" time="0.010101"/>
<testcase classname="functionTests" name="checkGetBoundsVectorTwoArg" time="0.0074763"/>
</testsuite>
</testsuites>

0 comments on commit c319524

Please sign in to comment.