mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-13 22:04:09 +02:00
Updated tests to fix some Win32 issues
This commit is contained in:
parent
79149d6a7c
commit
fbb06862b3
3 changed files with 58 additions and 0 deletions
|
@ -9,6 +9,10 @@ StartupProject = "Tests"
|
||||||
BfOptimizationLevel = "O0"
|
BfOptimizationLevel = "O0"
|
||||||
IntermediateType = "ObjectAndIRCode"
|
IntermediateType = "ObjectAndIRCode"
|
||||||
|
|
||||||
|
[Configs.Debug.Linux64]
|
||||||
|
Toolset = "GNU"
|
||||||
|
EnableRealtimeLeakCheck = false
|
||||||
|
|
||||||
[Configs.Test.Win64]
|
[Configs.Test.Win64]
|
||||||
IntermediateType = "ObjectAndIRCode"
|
IntermediateType = "ObjectAndIRCode"
|
||||||
COptimizationLevel = "O2"
|
COptimizationLevel = "O2"
|
||||||
|
@ -23,6 +27,9 @@ ConfigSelections = {TestsB = {Config = "Test"}}
|
||||||
COptimizationLevel = "O2"
|
COptimizationLevel = "O2"
|
||||||
ConfigSelections = {TestsB = {Config = "Test"}}
|
ConfigSelections = {TestsB = {Config = "Test"}}
|
||||||
|
|
||||||
|
[Configs.Test.Win32]
|
||||||
|
ConfigSelections = {TestsB = {Config = "Test"}}
|
||||||
|
|
||||||
[Configs.TestFail.Win64]
|
[Configs.TestFail.Win64]
|
||||||
PreprocessorMacros = ["TESTFAIL"]
|
PreprocessorMacros = ["TESTFAIL"]
|
||||||
BuildKind = "Normal"
|
BuildKind = "Normal"
|
||||||
|
|
|
@ -32,6 +32,25 @@ namespace Tests
|
||||||
{
|
{
|
||||||
return mA + mB + a;
|
return mA + mB + a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TestLambda() mut
|
||||||
|
{
|
||||||
|
delegate int(ref int a, ref int b) dlg = scope [&] (a, b) =>
|
||||||
|
{
|
||||||
|
a += 20;
|
||||||
|
b += 30;
|
||||||
|
mA++;
|
||||||
|
return mA + a + b;
|
||||||
|
};
|
||||||
|
|
||||||
|
mA = 100;
|
||||||
|
int testA = 8;
|
||||||
|
int testB = 9;
|
||||||
|
Test.Assert(dlg(ref testA, ref testB) == 100+1 + 20+8 + 30+9);
|
||||||
|
Test.Assert(testA == 28);
|
||||||
|
Test.Assert(testB == 39);
|
||||||
|
Test.Assert(mA == 101);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct NonSplattable
|
struct NonSplattable
|
||||||
|
@ -53,6 +72,30 @@ namespace Tests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ClassA
|
||||||
|
{
|
||||||
|
public int mA;
|
||||||
|
|
||||||
|
public void TestLambda()
|
||||||
|
{
|
||||||
|
delegate int(ref int a, ref int b) dlg = scope (a, b) =>
|
||||||
|
{
|
||||||
|
a += 20;
|
||||||
|
b += 30;
|
||||||
|
mA++;
|
||||||
|
return mA + a + b;
|
||||||
|
};
|
||||||
|
|
||||||
|
mA = 100;
|
||||||
|
int testA = 8;
|
||||||
|
int testB = 9;
|
||||||
|
Test.Assert(dlg(ref testA, ref testB) == 100+1 + 20+8 + 30+9);
|
||||||
|
Test.Assert(testA == 28);
|
||||||
|
Test.Assert(testB == 39);
|
||||||
|
Test.Assert(mA == 101);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public static void TestBasics()
|
public static void TestBasics()
|
||||||
{
|
{
|
||||||
|
@ -89,6 +132,10 @@ namespace Tests
|
||||||
dlg = scope => (ref val2).NonMutMethod;
|
dlg = scope => (ref val2).NonMutMethod;
|
||||||
Test.Assert(dlg(9) == 319);
|
Test.Assert(dlg(9) == 319);
|
||||||
Test.Assert(val2.mB == 300);
|
Test.Assert(val2.mB == 300);
|
||||||
|
|
||||||
|
val1.TestLambda();
|
||||||
|
ClassA ca = scope .();
|
||||||
|
ca.TestLambda();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,10 @@ md stats
|
||||||
IDE\dist\BeefBuild_d -proddir=IDEHelper\Tests -test
|
IDE\dist\BeefBuild_d -proddir=IDEHelper\Tests -test
|
||||||
@IF %ERRORLEVEL% NEQ 0 GOTO HADERROR
|
@IF %ERRORLEVEL% NEQ 0 GOTO HADERROR
|
||||||
|
|
||||||
|
@ECHO Testing IDEHelper\Tests (Win32)
|
||||||
|
IDE\dist\BeefBuild_d -proddir=IDEHelper\Tests -test -platform=Win32
|
||||||
|
@IF %ERRORLEVEL% NEQ 0 GOTO HADERROR
|
||||||
|
|
||||||
@ECHO Testing SysMSVCRT
|
@ECHO Testing SysMSVCRT
|
||||||
del IDE\Tests\SysMSVCRT\build\Debug_Win64\SysMSVCRT\SysMSVCRT.exe
|
del IDE\Tests\SysMSVCRT\build\Debug_Win64\SysMSVCRT\SysMSVCRT.exe
|
||||||
IDE\dist\BeefBuild_d -proddir=IDE\Tests\SysMSVCRT
|
IDE\dist\BeefBuild_d -proddir=IDE\Tests\SysMSVCRT
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue