mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-31 03:32:28 +00:00 
			
		
		
		
	Java API: bugfixes
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
		
							parent
							
								
									1ed4e7c480
								
							
						
					
					
						commit
						bbfd9dd19f
					
				
					 3 changed files with 14 additions and 14 deletions
				
			
		|  | @ -882,10 +882,10 @@ class JavaExample | |||
|         Expr inum = rn.Numerator(); | ||||
|         Expr iden = rn.Denominator(); | ||||
|         System.out.println("Numerator: " + inum + " Denominator: " + iden); | ||||
|         if (inum.toString() != "42" || iden.toString() != "43") | ||||
|         if (!inum.toString().equals("42") || !iden.toString().equals("43")) | ||||
|             throw new TestFailedException(); | ||||
| 
 | ||||
|         if (rn.ToDecimalString(3) != "0.976?") | ||||
|         if (!rn.ToDecimalString(3).toString().equals("0.976?")) | ||||
|             throw new TestFailedException(); | ||||
| 
 | ||||
|         BigIntCheck(ctx, ctx.MkReal("-1231231232/234234333")); | ||||
|  | @ -895,23 +895,23 @@ class JavaExample | |||
| 
 | ||||
|         String bn = "1234567890987654321"; | ||||
| 
 | ||||
|         if (ctx.MkInt(bn).BigInteger().toString() != bn) | ||||
|         if (!ctx.MkInt(bn).BigInteger().toString().equals(bn)) | ||||
|             throw new TestFailedException(); | ||||
| 
 | ||||
|         if (ctx.MkBV(bn, 128).BigInteger().toString() != bn) | ||||
|         if (!ctx.MkBV(bn, 128).BigInteger().toString().equals(bn)) | ||||
|             throw new TestFailedException(); | ||||
| 
 | ||||
|         if (ctx.MkBV(bn, 32).BigInteger().toString() == bn) | ||||
|         if (ctx.MkBV(bn, 32).BigInteger().toString().equals(bn)) | ||||
|             throw new TestFailedException(); | ||||
| 
 | ||||
|         // Error handling test. | ||||
|         try | ||||
|         { | ||||
|             Expr plus_ri = ctx.MkAdd(new ArithExpr[] { ctx.MkInt(1), | ||||
|                     ctx.MkReal(2) }); | ||||
|             IntExpr i = ctx.MkInt("0.5"); | ||||
|             throw new TestFailedException(); // unreachable | ||||
|         } catch (Z3Exception e) | ||||
|         { | ||||
|             System.out.println("GOT: " + e.getMessage()); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  | @ -2211,9 +2211,13 @@ class JavaExample | |||
|         } catch (TestFailedException ex) | ||||
|         { | ||||
|             System.out.println("TEST CASE FAILED: " + ex.getMessage()); | ||||
|             System.out.println("Stack trace: "); | ||||
|             ex.printStackTrace(System.out);      | ||||
|         } catch (Exception ex) | ||||
|         { | ||||
|             System.out.println("Unknown Exception: " + ex.getMessage()); | ||||
|             System.out.println("Stack trace: "); | ||||
|             ex.printStackTrace(System.out); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue