mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-18 11:09:28 +01:00
Fix #14362, 4b677e8256
: Class with non static methods may have a default constructor (#14363)
This commit is contained in:
parent
1cd0391926
commit
d0b56022d8
@ -351,7 +351,7 @@ foreach(LINE IN LISTS SOURCE_LINES)
|
||||
else()
|
||||
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.PreRegister(engine, \"${API_SUPER_CLS}\");")
|
||||
endif()
|
||||
if(DEFINED CLS_PARAMS AND NOT "${SUPER_CLS}" MATCHES "^ScriptEvent" AND NOT "${CLS}" STREQUAL "ScriptEvent")
|
||||
if((DEFINED CLS_PARAMS OR DEFINED METHODS) AND NOT "${SUPER_CLS}" MATCHES "^ScriptEvent" AND NOT "${CLS}" STREQUAL "ScriptEvent")
|
||||
if("${CLS_TYPES}" STREQUAL "v")
|
||||
string(APPEND SQUIRREL_EXPORT "\n\tSQ${API_CLS}.AddSQAdvancedConstructor(engine);")
|
||||
else()
|
||||
|
@ -2023,6 +2023,33 @@ function Regression::Math()
|
||||
print(" 13725 > -2147483648: " + ( 13725 > -2147483648));
|
||||
}
|
||||
|
||||
function Regression::PriorityQueue()
|
||||
{
|
||||
print("");
|
||||
print("--PriorityQueue--");
|
||||
local queue = AIPriorityQueue();
|
||||
print(" IsEmpty(): " + queue.IsEmpty());
|
||||
print(" Count(): " + queue.Count());
|
||||
print(" --Insert--")
|
||||
for (local i = 0; i < 10; i++) {
|
||||
print(" Insert(" + i + ", " + i + "): " + queue.Insert(i, i));
|
||||
}
|
||||
print(" Exists(5): " + queue.Exists(5));
|
||||
print(" Insert(5, 5): "+ queue.Insert(5, 5));
|
||||
print(" IsEmpty(): " + queue.IsEmpty());
|
||||
print(" Count(): " + queue.Count());
|
||||
local item = queue.Peek();
|
||||
print(" Peek(): " + item);
|
||||
print(" Count(): " + queue.Count());
|
||||
local item2 = queue.Pop();
|
||||
print(" Pop(): " + item2);
|
||||
print(" Count(): " + queue.Count());
|
||||
print(" " + item + " == " + item2 + " : " + (item == item2));
|
||||
print(" Clear(): " + queue.Clear());
|
||||
print(" IsEmpty(): " + queue.IsEmpty());
|
||||
print(" Count(): " + queue.Count());
|
||||
}
|
||||
|
||||
function Regression::Start()
|
||||
{
|
||||
this.TestInit();
|
||||
@ -2119,6 +2146,7 @@ function Regression::Start()
|
||||
print(" IsEventWaiting: false");
|
||||
|
||||
this.Math();
|
||||
this.PriorityQueue();
|
||||
|
||||
/* Check Valuate() is actually limited, MUST BE THE LAST TEST. */
|
||||
print("--Valuate() with excessive CPU usage--")
|
||||
|
@ -9804,11 +9804,38 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
-1 > 2147483647: false
|
||||
-2147483648 > 2147483647: false
|
||||
13725 > -2147483648: true
|
||||
|
||||
--PriorityQueue--
|
||||
IsEmpty(): true
|
||||
Count(): 0
|
||||
--Insert--
|
||||
Insert(0, 0): true
|
||||
Insert(1, 1): true
|
||||
Insert(2, 2): true
|
||||
Insert(3, 3): true
|
||||
Insert(4, 4): true
|
||||
Insert(5, 5): true
|
||||
Insert(6, 6): true
|
||||
Insert(7, 7): true
|
||||
Insert(8, 8): true
|
||||
Insert(9, 9): true
|
||||
Exists(5): true
|
||||
Insert(5, 5): true
|
||||
IsEmpty(): false
|
||||
Count(): 11
|
||||
Peek(): 0
|
||||
Count(): 11
|
||||
Pop(): 0
|
||||
Count(): 10
|
||||
0 == 0 : true
|
||||
Clear(): (null : 0x00000000)
|
||||
IsEmpty(): true
|
||||
Count(): 0
|
||||
--Valuate() with excessive CPU usage--
|
||||
constructor failed with: excessive CPU usage in list filter function
|
||||
Your script made an error: excessive CPU usage in valuator function
|
||||
|
||||
*FUNCTION [Start()] regression/main.nut line [2133]
|
||||
*FUNCTION [Start()] regression/main.nut line [2161]
|
||||
|
||||
[Infinite] CLOSURE
|
||||
[list] INSTANCE
|
||||
|
Loading…
Reference in New Issue
Block a user