Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests for Version 1.0.0 release #71

Merged
merged 1 commit into from Sep 3, 2022

Conversation

craigthomas
Copy link
Owner

This PR adds several new unit tests to cover various aspects of the code base that do not have proper unit tests. Significantly, this PR refactors many error handling routines, and pushes them up to outer classes to handle more cleanly. This PR also separates out I/O functions from the assembly routines, so that only data buffers are passed from object to object (this makes for simpler unit testing). Additionally, VirtualFile classes were overhauled, with a new VirtualFileContainer class introduced to distinguish between various container types such as cassette images, disk images, hard disk images, etc. Unit tests are still missing on source_file.py and virtual_file.py as the issue #6 will involve further modification of those files to implement virtual disk access and manipulation. This PR closes #69

Complete all unit tests for values.py

Fix unit tests for calculating offsets in expressions.

Fix error with division in expressions.

Move IO and error printing out of lower level classes.

Fix for statement parsing - should be catching OperandTypeError

Catch and raise ParseError instead of OperandTypeError.

Catch all Exception errors and raise them during translation.

Add negative PCR 16-bit offset test.

Add unit tests for version 1 release.

Refactor virtual file support for easier testing.

Attempt to cover all of CassetteFile class.

Refactor cassette and binary files to be inherited container classes.

Move unit tests into proper packages.

Add unit tests for CoCoFile objects.

Add unit tests for SourceFile objects.

Update assembler so it can produce binary files.

Update file_util with new virtual file structures.

Add missing test for BinaryFile objects.
@codecov
Copy link

codecov bot commented Sep 3, 2022

Codecov Report

Merging #71 (02031af) into main (d614b9d) will increase coverage by 7.70%.
The diff coverage is 81.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #71      +/-   ##
==========================================
+ Coverage   82.55%   90.25%   +7.70%     
==========================================
  Files          11       15       +4     
  Lines        1536     1581      +45     
==========================================
+ Hits         1268     1427     +159     
+ Misses        268      154     -114     
Impacted Files Coverage Δ
cocoasm/virtualfiles/disk.py 0.00% <0.00%> (ø)
cocoasm/virtualfiles/virtual_file.py 0.00% <0.00%> (ø)
cocoasm/virtualfiles/source_file.py 75.67% <75.67%> (ø)
cocoasm/operands.py 98.28% <100.00%> (+0.41%) ⬆️
cocoasm/program.py 100.00% <100.00%> (+18.26%) ⬆️
cocoasm/statement.py 100.00% <100.00%> (+10.42%) ⬆️
cocoasm/values.py 100.00% <100.00%> (+5.69%) ⬆️
cocoasm/virtualfiles/binary.py 100.00% <100.00%> (+30.76%) ⬆️
cocoasm/virtualfiles/cassette.py 100.00% <100.00%> (+41.40%) ⬆️
cocoasm/virtualfiles/coco_file.py 100.00% <100.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d614b9d...02031af. Read the comment docs.

@craigthomas craigthomas merged commit 861e818 into main Sep 3, 2022
@craigthomas craigthomas deleted the version-1-test-coverage branch September 5, 2022 14:55
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.

Increase test coverage for Version 1.0.0 release
1 participant