-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix decrement vtable override, tests for:
abs, decrement, div_* fdiv_*, i_abs, i_div_*, i_fdiv_*, i_mod*, i_neg, increment, mod_*, neg
- Loading branch information
Showing
27 changed files
with
594 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_abs { | ||
function test_mpz_abs() { | ||
var x = new GMP.Integer(); | ||
var y = new GMP.Integer(30); | ||
${ abs x, y }; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 30); | ||
y = new GMP.Integer(-24); | ||
${ abs x, y }; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 24); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_abs); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_decrement { | ||
function test_mpz_decrement() { | ||
var x = new GMP.Integer(30); | ||
${ dec x }; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 29); | ||
${ dec x }; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 28); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_decrement); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_div { | ||
function test_mpz_div() { | ||
var x = new GMP.Integer(); | ||
var y = new GMP.Integer(65); | ||
var z = new GMP.Integer(32); | ||
${ div x, y, z}; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 2); | ||
${ div x, x, y}; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 0); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_div); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_div_float { | ||
function test_mpz_div_float() { | ||
var x = new GMP.Integer(); | ||
var y = new GMP.Integer(65); | ||
float z = 32.1; | ||
${ div x, y, z}; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 2); | ||
${ div x, x, z}; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 0); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_div_float); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_div_int { | ||
function test_mpz_div_int() { | ||
var x = new GMP.Integer(); | ||
var y = new GMP.Integer(65); | ||
int z = 32; | ||
${ div x, y, z}; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 2); | ||
${ div x, x, z}; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 0); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_div_int); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_fdiv { | ||
function test_mpz_fdiv() { | ||
var x = new GMP.Integer(); | ||
var y = new GMP.Integer(65); | ||
var z = new GMP.Integer(32); | ||
${ fdiv x, y, z}; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 2); | ||
${ fdiv x, x, y}; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 0); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_fdiv); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_fdiv_float { | ||
function test_mpz_fdiv_float() { | ||
var x = new GMP.Integer(); | ||
var y = new GMP.Integer(65); | ||
float z = 32.1; | ||
${ fdiv x, y, z}; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 2); | ||
${ fdiv x, x, z}; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 0); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_fdiv_float); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_fdiv_int { | ||
function test_mpz_fdiv_int() { | ||
var x = new GMP.Integer(); | ||
var y = new GMP.Integer(65); | ||
int z = 32; | ||
${ fdiv x, y, z}; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 2); | ||
${ fdiv x, x, z}; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 0); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_fdiv_int); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_i_abs { | ||
function test_mpz_i_abs() { | ||
var x = new GMP.Integer(30); | ||
${ abs x}; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 30); | ||
x = new GMP.Integer(-24); | ||
${ abs x}; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 24); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_i_abs); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_i_div { | ||
function test_mpz_i_div() { | ||
var x = new GMP.Integer(65); | ||
var y = new GMP.Integer(32); | ||
${ div x, y}; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 2); | ||
${ div x, y}; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 0); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_i_div); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_i_div_float { | ||
function test_mpz_i_div_float() { | ||
var x = new GMP.Integer(65); | ||
float y = 32.1; | ||
${ div x, y}; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 2); | ||
${ div x, y}; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 0); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_i_div_float); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_i_div_int { | ||
function test_mpz_i_div_int() { | ||
var x = new GMP.Integer(65); | ||
int y = 32; | ||
${ div x, y}; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 2); | ||
${ div x, y}; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 0); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_i_div_int); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_i_fdiv { | ||
function test_mpz_i_fdiv() { | ||
var x = new GMP.Integer(65); | ||
var y = new GMP.Integer(32); | ||
${ fdiv x, y}; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 2); | ||
${ fdiv x, y}; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 0); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_i_fdiv); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$load "rosella/test.pbc"; | ||
$load "GMP/Integer.pbc"; | ||
|
||
namespace GMP { | ||
class Integer; | ||
} | ||
|
||
class Test_GMP_Vtable_i_fdiv_float { | ||
function test_mpz_i_fdiv_float() { | ||
var x = new GMP.Integer(65); | ||
float y = 32.1; | ||
${ fdiv x, y}; | ||
int i = mpz_get_ui(x); | ||
self.assert.equal(i, 2); | ||
${ fdiv x, y}; | ||
i = mpz_get_ui(x); | ||
self.assert.equal(i, 0); | ||
} | ||
} | ||
|
||
function main[main]() { | ||
using Rosella.Test.test; | ||
test(class Test_GMP_Vtable_i_fdiv_float); | ||
} |
Oops, something went wrong.