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

Failing tests "VirtualStackTest.java" #257

Open
odinsbane opened this issue Aug 20, 2024 · 0 comments
Open

Failing tests "VirtualStackTest.java" #257

odinsbane opened this issue Aug 20, 2024 · 0 comments

Comments

@odinsbane
Copy link

There are two tests failing for the VirtualStackTest public void testGetDirectory() fails because VirtualStack#getDirectory uses, "IJ.addSeparator" which changes the string. The simple fix is to change the test to:

assertEquals(IJ.addSeparator("mySuperDuperPath"),vs.getDirectory());

Maybe the correct way would be to convert the original path and the returned path to a path object and make sure they point at the same place.

The second test public void testDeleteSlice() failes because VirtualStack#deleteSlice just returns if the stack is empty. The test implies the method should fail. Maybe the test needs to check another way, eg If the size doesn't change, then the delete failed?

Alternatively comment the two lines, and now it fails.

    /** Deletes the specified slice, where {@literal 1<=n<=nslices}. */
public void deleteSlice(int n) {
	#if (nSlices==0)
	#	return;
	if (n<1 || n>nSlices)
		throw new IllegalArgumentException("Argument out of range: "+n);
	for (int i=n; i<nSlices; i++)
		names[i-1] = names[i];
	names[nSlices-1] = null;
	nSlices--;
}
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

No branches or pull requests

1 participant