Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360679

Summary: Expecting an exception when divide Float or Smallfloat by zero
Product: z_Archived Reporter: Kathy Carroll <carrollk>
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jeffdouglas
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kathy Carroll CLA 2011-10-12 11:15:02 EDT
RBD throws a Runtime exception in this case.  In EDT all other number types throw an JavaObjectException


program driver type BasicProgram {}

	function main()
		testDivisionFloat();
		testDivisionSmallFloat();
	end
	
	function testDivisionFloat()
		
		variation string = "Float variable /  0 ";
		failDetails string;
		float1 float = 2.539E7;
		floatActual float;
		zero float = 0;
		try
			floatActual = float1 / zero;
			failDetails = variation + " no exception ";
			syslib.writestdout("failed " + failDetails);
		onException (expect JavaObjectException)
			failDetails = "OK exceptionType " + expect.exceptionType;
			syslib.writestdout(failDetails);
		onException (wrong AnyException)
			failDetails = variation + " wrong exception ";
			syslib.writestdout("failed " + failDetails);
		end
	end
	
	function testDivisionSmallFloat()
		
		variation string = "SmallFloat variable / 0 ";
		failDetails string;
		smallFloat1 smallFloat = 2.539E7;
		zero smallFloat = 0;
		floatActual smallFloat;
		try
			floatActual = smallFloat1 / zero;
			failDetails = variation + " no exception ";
			syslib.writestdout("failed " + failDetails);
		onException (expect JavaObjectException)
			failDetails = "OK exceptionType " + expect.exceptionType;
			syslib.writestdout(failDetails);
		onException (wrong AnyException)
			failDetails = variation + " wrong exception ";
			syslib.writestdout("failed " + failDetails);
		end
	end
	
end
Comment 1 Jeff Douglas CLA 2011-10-21 16:21:21 EDT
fixed
Comment 2 Kathy Carroll CLA 2011-10-25 11:54:19 EDT
verified with build 201110241434 & closed