1468 : TestFramework
1469{
1472
1473
1474
1475
1477 {
1479
1490 }
1491
1492
1493
1494
1496 {
1498 }
1499
1500
1501
1502
1503
1505 {
1509 {
1512 }
1513
1515 }
1516
1517
1518
1520 {
1524 {
1527 }
1528
1530 }
1531
1532
1533
1535 {
1537
1539 {
1542
1544 {
1547 }
1548
1550 {
1553
1555 {
1558 }
1559 }
1560 }
1561
1562
1567 {
1570 }
1571
1575 {
1578 }
1579
1580
1583 }
1584
1585
1586
1588 {
1590
1592
1594 {
1597 }
1598
1601
1603 {
1606 }
1607
1610
1612 {
1615 }
1616
1617
1620 }
1621
1622
1623
1625 {
1627
1629
1630
1632 {
1635 }
1636
1638 {
1641 }
1642
1644 {
1647 }
1648
1649
1652 }
1653
1654
1655
1657 {
1658
1660
1661
1664 {
1666 }
1667
1668
1671 {
1673 }
1674
1676 {
1678 }
1679
1680
1683
1685 {
1688 }
1689
1690
1693
1694
1695
1697
1698
1701
1702
1707
1708
1710
1711
1713 {
1715
1718
1720
1722 }
1723
1725 {
1727
1730
1732
1734 }
1735
1736
1738
1739
1740 for (
int i = 0;
i < 1000; ++
i)
1741 {
1743 }
1744
1745
1749
1750 Debug.
TFLog(
"Game fncs:",
this,
"TestModule");
1751
1754 {
1756 Debug.
TFLog(
string.Format(
" time: %1 | fnc: %2",
tfp.param1,
tfp.param2),
this,
"TestModule");
1757
1758 if (!
Assert(
tfp.param2 !=
"EnumTools::StringToEnum"))
1759 {
1761
1764
1766
1768 }
1769 }
1770
1773
1776 {
1780 {
1782
1785
1787
1789 }
1790
1791
1793 {
1795
1798
1800
1802 }
1803 }
1804
1805
1810
1812
1813 Debug.
TFLog(
"Core fncs:",
this,
"TestModule");
1814
1817 {
1819 Debug.
TFLog(
string.Format(
" time: %1 | fnc: %2",
tfpc.param1,
tfpc.param2),
this,
"TestModule");
1820
1821 if (
tfpc.param2 ==
"EnumTools::StringToEnum")
1822 {
1824 break;
1825 }
1826 }
1827
1829
1830
1836
1839
1842
1844 }
1845
1846
1847
1849 {
1850
1853
1854
1856
1857
1859
1860
1867
1869
1870
1874
1875
1877 {
1879 }
1880
1882 {
1884 }
1885
1887 {
1889 }
1890
1892 }
1893
1894
1895
1897 {
1901
1902
1904
1905
1908
1911 {
1913 }
1914
1916 {
1918 }
1919
1922
1925
1927
1928
1931
1932
1934 {
1936 }
1937
1939 {
1941 }
1942
1944 }
1945
1946
1947
1949 {
1950
1953
1954
1956
1957
1963
1969
1971
1972
1975 {
1977 }
1978
1979
1981 {
1983 }
1984
1986 {
1988 }
1989
1991 {
1993 }
1994
1996 {
1998 }
1999
2000
2002 {
2004 }
2005
2007 }
2008
2009
2010
2012 {
2013
2015
2016
2017
2018
2020 GetGame().GameScript.CallFunction(
this,
"TestFuncCountDataHelper",
null, 0);
2022
2024
2025
2027 GetGame().GameScript.CallFunctionParams(
this,
"TestFuncCountDataHelper",
null,
null);
2029
2031
2032
2036
2038
2039
2041 GetGame().GameScript.Call(
this,
"TestFuncCountDataHelper", 0);
2043
2045
2046
2048
2049
2053
2055
2056
2060
2062
2063
2064
2067
2068
2069
2071
2072
2073
2076
2077
2078
2081
2082
2083
2086
2087
2089 {
2091 }
2092
2093
2094
2095
2097 {
2099 }
2100
2101
2103 {
2105 }
2106
2107
2109 {
2111 }
2112
2113
2115 {
2117 }
2118
2119
2121 {
2123 }
2124
2125
2127 {
2129 }
2130
2131
2133 {
2135 }
2136
2137
2139 {
2141 }
2142
2143
2145 {
2147 }
2148
2149
2151 {
2153 }
2154
2155
2157 {
2159 }
2160
2161
2163 {
2165 }
2166
2168 }
2169
2170
2171
2172
2173
2175 {
2178 {
2179
2180 }
2181
2183 }
2184
2185
2186
2188 {
2190
2191 for (
int i = 0;
i < 1000; ++
i)
2192 {
2193 string example =
string.Format(
"This %1 is %2 just %3 an %4 example %5",
i,
Type(),
this,
startTime,
"lorem ipsum 1 2 3");
2194 }
2195
2197 }
2198
2199
2200
2202 {
2204
2205 for (
int i = 0;
i < 1000; ++
i)
2206 {
2207 string example =
"This " +
i +
" is " +
Type() +
" just " +
this +
" an " +
startTime +
" example " +
"lorem ipsum 1 2 3";
2208 }
2209
2211 }
2212
2213
2214
2216 {
2218 }
2219
2220
2221
2223 {
2225 }
2226}
2227
2229{
2231 {
2234 {
2235
2236 }
2237
2239 }
2241 {
2244 {
2245
2246 }
2247
2249 }
2250
2252 {
2254
2257
2259 }
2260}
DayZGame GetDayZGame()
Definition DayZGame.c:3817
void ~EnProfilerTests()
Definition EnProfilerTests.c:789
TFResult TestModule()
Definition EnProfilerTests.c:950
TFResult TestFuncTimeData()
Definition EnProfilerTests.c:1242
TFResult TestClassTimeData()
Definition EnProfilerTests.c:1142
TFResult TestFuncCountData()
Definition EnProfilerTests.c:1305
void TestFuncCountDataHelper()
Definition EnProfilerTests.c:1509
void EnProfilerTests()
Definition EnProfilerTests.c:770
TFResult TestSetFlags()
Definition EnProfilerTests.c:828
float Sleep(float timeS)
Definition EnProfilerTests.c:1468
TFResult TestTogglingImmediate()
Definition EnProfilerTests.c:813
float StringFormat()
Definition EnProfilerTests.c:1481
TFResult TestToggling()
Definition EnProfilerTests.c:798
TFResult TestAddFlags()
Definition EnProfilerTests.c:918
TFResult TestClearFlags()
Definition EnProfilerTests.c:881
TFResult TestClassCountData()
Definition EnProfilerTests.c:1190
float StringConcat()
Definition EnProfilerTests.c:1495
static void TestFuncCountDataHelperStatic()
Definition EnProfilerTests.c:1516
bool m_bWasProfilerEnabled
Remember this, so we can restore the previous state before the test!
Definition EnProfilerTests.c:765
string Type
Definition JsonDataContaminatedArea.c:11
TFResult NTFR(TFR result)
Definition TestFramework.c:273
bool Assert(bool condition)
Definition TestFramework.c:262
void TFResult(TFR result)
Definition TestFramework.c:12
TFR
Definition TestFramework.c:2
void AddInitTest(string test)
Definition TestFramework.c:249
TFResult BTFR(bool result)
Definition TestFramework.c:278
static void TFLog(string message=LOG_DEFAULT, TestFramework caller=null, string function="")
Definition Debug.c:191
Set of methods for accessing script profiling data.
Definition EnProfiler.c:73
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
Definition ErrorModuleHandler.c:29
static proto native ErrorModuleHandler GetInstance()
Gets the EMH Instance.
ErrorExSeverity
Definition EnDebug.c:62
static proto float AbsFloat(float f)
Returns absolute value.
static bool IsEnabledP()
Return if script profiling is enabled through EnProfiler.
Definition EnProfiler.c:138
static proto int GetTimeResolution()
Get the currently set time resolution.
static proto int GetAllocationsOfClass(typename clss, bool immediate=false)
Obtain [SD] or [PD] regarding the allocations of a specific class.
static proto EnProfilerModule GetModule()
Get the currently profiled module.
static proto int SetFlags(int flags, bool sessionReset=true)
Override the currently used set of EnProfilerFlags across the API.
static proto void ResetSession(bool fullReset=false)
Perform [SR], clearing SessionFrame, ProfiledSessionFrames, [SD] and [PD] (except for [CI])
static proto void GetTimePerFunc(notnull out array< ref EnProfilerTimeFuncPair > outArr, int count=int.MAX)
Obtain [SD] for Time Per Function.
static proto int AddFlags(int flags, bool sessionReset=true)
Add flags to the currently used set of EnProfilerFlags across the API.
static proto void SetTimeResolution(int resolution)
Set the resolution of the fetched Time data.
static proto float GetTimeOfClass(typename clss, bool immediate=false)
Obtain [SD] or [PD] regarding the time a specific class consumed.
static proto void SetModule(EnProfilerModule module, bool sessionReset=true)
Set the module to be profiled.
static bool IsEnabledC()
Return if script profiling is actually turned on inside of the script context.
Definition EnProfiler.c:152
static proto float GetTimeOfFunc(string funct, typename clss, bool immediate=false)
Obtain [SD] or [PD] regarding the time consumed by a specific function.
static bool RequestImmediateData()
Helper method to ascertain the profiler will record [PD] right after this call.
Definition EnProfiler.c:745
static proto void GetTimePerClass(notnull out array< ref EnProfilerTimeClassPair > outArr, int count=int.MAX)
Obtain [SD] for Time Per Class.
static proto int GetInstancesOfClass(typename clss, bool immediate=false)
Obtain [SD] or [PD] regarding the [CI] of a specific class.
static proto void Enable(bool enable, bool immediate=false, bool sessionReset=true)
Enable the gathering of script profiling data.
static proto bool NameToModule(string moduleName, out EnProfilerModule module)
Convert string to EnProfilerModule.
static proto void SortData()
The internal sorting that happens at the end of the frame (so it is NOT necessary to call this manual...
static proto int GetFlags()
Get the currently used flags across the API.
static proto int GetCountOfFunc(string funct, typename clss, bool immediate=false)
Obtain [SD] or [PD] regarding the amount of times a specific function was called.
EnProfilerFlags
Flags that influences the behaviour of the EnProfiler API, applied through ...Flags functions.
Definition EnProfiler.c:9
EnProfilerModule
Current base scripted modules.
Definition EnProfiler.c:22
static proto int GetCountOfFuncG(string funct, bool immediate=false)
Obtain [SD] or [PD] regarding the amount of times a specific function was called.
static proto int ClearFlags(bool sessionReset=true)
Remove all flags from the currently used set of EnProfilerFlags across the API.
static proto int RemoveFlags(int flags, bool sessionReset=true)
Remove flags from the currently used set of EnProfilerFlags across the API.