-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shawn David Pringle, B.Sc.
committed
Dec 30, 2024
1 parent
793ba70
commit b32e075
Showing
9 changed files
with
131 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ source/creole | |
source/eudoc | ||
tests/return15 | ||
tests/warnings_issued*.txt | ||
builds |
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,6 @@ | ||
tests/t_c_890-1.e:6 in type boolean() | ||
Expected a routine_id of a procedure. Not that of a function (bad_cleanup_routine). | ||
i1 = <no value> | ||
|
||
|
||
Public & Export & Global & Local Variables |
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,32 @@ | ||
include std/unittest.e | ||
include std/os.e | ||
|
||
enum KEYBOARD = 0, SCREEN | ||
|
||
type enum boolean FALSE = 0, TRUE | ||
end type | ||
|
||
boolean cleaned = FALSE | ||
|
||
function bad_cleanup_routine(object x) | ||
cleaned = TRUE | ||
return 0 | ||
end function | ||
|
||
function new_object_with_cleanup() | ||
return delete_routine(1, routine_id("bad_cleanup_routine")) | ||
end function | ||
|
||
integer x = new_object_with_cleanup() | ||
|
||
-- should clean up x here | ||
x = 4 | ||
|
||
while x do | ||
x = x - 1 | ||
end while | ||
|
||
test_pass("Able to operate with a destructor assigned to integer\n") | ||
test_true("cleanup_routine_called", cleaned) | ||
|
||
test_report() |
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,6 @@ | ||
/home/leprechaun/Source/euphoria/tests/t_c_890-2.e:6 in type boolean() | ||
Expected a routine_id of a procedure which takes only one argument, not bad_cleanup_routine which takes 0. | ||
i1 = <no value> | ||
|
||
|
||
Public & Export & Global & Local Variables |
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,31 @@ | ||
include std/unittest.e | ||
include std/os.e | ||
|
||
enum KEYBOARD = 0, SCREEN | ||
|
||
type enum boolean FALSE = 0, TRUE | ||
end type | ||
|
||
boolean cleaned = FALSE | ||
|
||
procedure bad_cleanup_routine() | ||
cleaned = TRUE | ||
end procedure | ||
|
||
function new_object_with_cleanup() | ||
return delete_routine(1, routine_id("bad_cleanup_routine")) | ||
end function | ||
|
||
integer x = new_object_with_cleanup() | ||
|
||
-- should clean up x here | ||
x = 4 | ||
|
||
while x do | ||
x = x - 1 | ||
end while | ||
|
||
test_pass("Able to operate with a destructor assigned to integer\n") | ||
test_true("cleanup_routine_called", cleaned) | ||
|
||
test_report() |
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,7 @@ | ||
euphoria/tests/t_c_890-3.e:6 in type boolean() | ||
invalid routine id | ||
i1 = <no value> | ||
|
||
|
||
Public & Export & Global & Local Variables | ||
|
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,32 @@ | ||
include std/unittest.e | ||
include std/os.e | ||
|
||
enum KEYBOARD = 0, SCREEN | ||
|
||
type enum boolean FALSE = 0, TRUE | ||
end type | ||
|
||
boolean cleaned = FALSE | ||
|
||
function bad_cleanup_routine(object x) | ||
cleaned = TRUE | ||
return 0 | ||
end function | ||
|
||
function new_object_with_cleanup() | ||
return delete_routine(1, -5) | ||
end function | ||
|
||
integer x = new_object_with_cleanup() | ||
|
||
-- should clean up x here | ||
x = 4 | ||
|
||
while x do | ||
x = x - 1 | ||
end while | ||
|
||
test_pass("Able to operate with a destructor assigned to integer\n") | ||
test_true("cleanup_routine_called", cleaned) | ||
|
||
test_report() |