Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360679 - Expecting an exception when divide Float or Smallfloat by zero
Summary: Expecting an exception when divide Float or Smallfloat by zero
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-12 11:15 EDT by Kathy Carroll CLA
Modified: 2017-02-23 14:19 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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