upgrade to JUCE 5.4.3. Remove (probably) unused JUCE modules. Remove VST2 target (it's been end-of-life'd by Steinberg and by JUCE)
This commit is contained in:
@ -62,7 +62,7 @@ namespace FunctionTestsHelpers
|
||||
|
||||
struct FunctionObject
|
||||
{
|
||||
FunctionObject() {}
|
||||
FunctionObject() = default;
|
||||
|
||||
FunctionObject (const FunctionObject& other)
|
||||
{
|
||||
@ -72,6 +72,26 @@ namespace FunctionTestsHelpers
|
||||
int operator()(int i) const { return bigData->sum() + i; }
|
||||
|
||||
std::unique_ptr<BigData> bigData { new BigData() };
|
||||
|
||||
JUCE_LEAK_DETECTOR (FunctionObject)
|
||||
};
|
||||
|
||||
struct BigFunctionObject
|
||||
{
|
||||
BigFunctionObject() = default;
|
||||
|
||||
BigFunctionObject (const BigFunctionObject& other)
|
||||
{
|
||||
bigData.reset (new BigData (*other.bigData));
|
||||
}
|
||||
|
||||
int operator()(int i) const { return bigData->sum() + i; }
|
||||
|
||||
std::unique_ptr<BigData> bigData { new BigData() };
|
||||
|
||||
int stackUsage[32];
|
||||
|
||||
JUCE_LEAK_DETECTOR (BigFunctionObject)
|
||||
};
|
||||
}
|
||||
|
||||
@ -95,13 +115,16 @@ public:
|
||||
|
||||
std::function<double(double, double)> f2 (FunctionTestsHelpers::multiply);
|
||||
expectEquals (6.0, f2 (2.0, 3.0));
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
beginTest ("Function objects");
|
||||
|
||||
std::function<int(int)> f1 = FunctionTestsHelpers::FunctionObject();
|
||||
expectEquals (f1 (5), FunctionTestsHelpers::BigData::bigDataSum + 5);
|
||||
|
||||
std::function<int(int)> f2 { FunctionTestsHelpers::BigFunctionObject() };
|
||||
expectEquals (f2 (5), FunctionTestsHelpers::BigData::bigDataSum + 5);
|
||||
}
|
||||
|
||||
{
|
||||
@ -174,13 +197,13 @@ public:
|
||||
beginTest ("move constructor");
|
||||
|
||||
std::unique_ptr<std::function<int()>> fStackTmp (new std::function<int()> (fStack));
|
||||
std::function<int()> f1 (static_cast<std::function<int()>&&> (*fStackTmp));
|
||||
std::function<int()> f1 (std::move (*fStackTmp));
|
||||
|
||||
fStackTmp.reset();
|
||||
expectEquals (f1(), 3);
|
||||
|
||||
std::unique_ptr<std::function<int()>> fHeapTmp (new std::function<int()> (fHeap));
|
||||
std::function<int()> f2 (static_cast<std::function<int()>&&> (*fHeapTmp));
|
||||
std::function<int()> f2 (std::move (*fHeapTmp));
|
||||
if (*fHeapTmp)
|
||||
expect (false);
|
||||
|
||||
@ -188,7 +211,7 @@ public:
|
||||
expectEquals (f2(), FunctionTestsHelpers::BigData::bigDataSum);
|
||||
|
||||
std::unique_ptr<std::function<int()>> fEmptyTmp (new std::function<int()>());
|
||||
std::function<int()> f3 (static_cast<std::function<int()>&&> (*fEmptyTmp));
|
||||
std::function<int()> f3 (std::move (*fEmptyTmp));
|
||||
fEmptyTmp.reset();
|
||||
if (f3)
|
||||
expect (false);
|
||||
@ -199,14 +222,14 @@ public:
|
||||
|
||||
std::function<int()> f1 (fHeap);
|
||||
std::unique_ptr<std::function<int()>> fStackTmp (new std::function<int()> (fStack));
|
||||
f1 = static_cast<std::function<int()>&&> (*fStackTmp);
|
||||
f1 = std::move (*fStackTmp);
|
||||
|
||||
fStackTmp.reset();
|
||||
expectEquals (f1(), 3);
|
||||
|
||||
std::function<int()> f2 (fStack);
|
||||
std::unique_ptr<std::function<int()>> fHeapTmp (new std::function<int()> (fHeap));
|
||||
f2 = static_cast<std::function<int()>&&> (*fHeapTmp);
|
||||
f2 = std::move (*fHeapTmp);
|
||||
if (*fHeapTmp)
|
||||
expect (false);
|
||||
|
||||
@ -215,7 +238,7 @@ public:
|
||||
|
||||
std::function<int()> f3 (fHeap);
|
||||
std::unique_ptr<std::function<int()>> fEmptyTmp (new std::function<int()>());
|
||||
f3 = static_cast<std::function<int()>&&> (*fEmptyTmp);
|
||||
f3 = std::move (*fEmptyTmp);
|
||||
fEmptyTmp.reset();
|
||||
if (f3)
|
||||
expect (false);
|
||||
|
Reference in New Issue
Block a user