GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add ShapeTests for Processing4 core module by aakritithecoder · Pull Request #1462 · processing/processing4

Conversation

@aakritithecoder

@aakritithecoder aakritithecoder commented Mar 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Added ShapeTests.java under core/test/processing to verify canvas width and height initialization.
This ensures Processing’s PGraphics behaves as expected when setSize() is called.
Closes #1488

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aakritithecoder
Add ShapeTests for Processing4
96fab27
@aakritithecoder

aakritithecoder commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

This test ensures that PGraphics initializes width and height correctly when setSize() is called.
It helps prevent regressions in canvas setup logic.
image
ShapeTests ran sucessfully !!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

catilac
catilac requested changes Mar 4, 2026
View reviewed changes

@catilac catilac left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving forward please create an issue first as per our guidelines.
This code is a good start for creating a test suite for PGraphics thank you!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread core/test/processing/ShapeTests.java Outdated
Comment on lines +6 to +11
public class ShapeTests {

@Test
public void testCanvasWidthAfterSetSize() {
// Create a PGraphics object and set its size
PGraphics pg = new PGraphics();

@catilac catilac Mar 4, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is testing PGraphics please update the class name, and place this in the core/test/processing/core folder

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread core/test/processing/ShapeTests.java Outdated
// Assert that the canvas height is 150
assertEquals(150, pg.height);
}
} No newline at end of file

@catilac catilac Mar 4, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test of the pg height can be done in the other test function that tests width.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread core/test/processing/ShapeTests.java Outdated
Comment on lines +14 to +17
pg.beginDraw();
pg.rect(10, 10, 100, 50); // draw a rectangle
pg.endDraw();

@catilac catilac Mar 4, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not necessary since you are testing setSize

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aakritithecoder
Rename ShapeTests to PGraphicsTests, move to core package, merge tests
6e44b68
@aakritithecoder aakritithecoder mentioned this pull request Mar 23, 2026
Add unit tests for PGraphics setSize() in core module #1488
Closed
@aakritithecoder

aakritithecoder commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

Hi @catilac ! I've addressed all the review feedback:

  • Renamed ShapeTests to PGraphicsTests
  • Moved file to core/test/processing/core/
  • Merged both test methods into one
  • Removed beginDraw()/rect()/endDraw() blocks

Also created an issue as per contributing guidelines: #1488

Please take a look!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@catilac

catilac commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

Amazing, thank you! It looks good. I'll merge after running build! 🎊

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

catilac
catilac approved these changes Apr 28, 2026
View reviewed changes
@catilac
catilac merged commit 24faa54 into processing:main Apr 28, 2026
11 of 12 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@catilac catilac catilac approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add unit tests for PGraphics setSize() in core module

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@aakritithecoder @catilac
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.