Skip to content

Commit 739074f

Browse files
committed
More tweaks
1 parent f442905 commit 739074f

9 files changed

+47
-71
lines changed

cmake/yup_modules.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function (_yup_module_collect_sources folder output_variable)
6767
set (base_path "${folder}/${module_name}")
6868
set (all_module_sources "")
6969

70-
foreach (extension ${source_extensions})
70+
foreach (extension IN LISTS source_extensions)
7171
file (GLOB found_source_files "${base_path}*${extension}")
7272

7373
if (NOT YUP_PLATFORM_MSFT)
@@ -118,7 +118,7 @@ function (_yup_module_collect_sources folder output_variable)
118118
endforeach()
119119

120120
set (module_sources "")
121-
foreach (module_source ${all_module_sources})
121+
foreach (module_source IN LISTS all_module_sources)
122122
if (APPLE)
123123
if (module_source MATCHES "^.*\.(cc|cxx|cpp)$")
124124
get_filename_component (source_directory ${module_source} DIRECTORY)
@@ -146,11 +146,11 @@ endfunction()
146146

147147
function (_yup_module_prepare_frameworks frameworks weak_frameworks output_variable)
148148
set (temp_frameworks "")
149-
foreach (framework ${frameworks})
149+
foreach (framework IN LISTS frameworks)
150150
list (APPEND temp_frameworks "-framework ${framework}")
151151
endforeach()
152152

153-
foreach (framework ${weak_frameworks})
153+
foreach (framework IN LISTS weak_frameworks)
154154
list (APPEND temp_frameworks "-weak_framework ${framework}")
155155
endforeach()
156156

@@ -345,7 +345,7 @@ function (yup_add_module module_path modules_definitions module_group)
345345
set (platform_properties "^(.*)Deps$|^(.*)Defines$|^(.*)Libs$|^(.*)Frameworks$|^(.*)WeakFrameworks$|^(.*)Options$|^(.*)LinkOptions$|^(.*)Packages$|^(.*)Searchpaths$|^(.*)CppStandard$")
346346

347347
set (parsed_config "")
348-
foreach (module_config ${module_configs})
348+
foreach (module_config IN LISTS module_configs)
349349
string (REGEX REPLACE "^(.+):[ \t\r\n]+(.+)$" "\\1;\\2" parsed_config ${module_config})
350350
list (GET parsed_config 0 key)
351351
list (LENGTH parsed_config parsed_config_len)
@@ -452,7 +452,7 @@ function (yup_add_module module_path modules_definitions module_group)
452452
list (APPEND module_link_options ${module_linuxLinkOptions})
453453
_yup_resolve_variable_paths ("${module_linuxSearchpaths}" module_linuxSearchpaths)
454454
list (APPEND module_searchpaths ${module_linuxSearchpaths})
455-
foreach (package ${module_linuxPackages})
455+
foreach (package IN LISTS module_linuxPackages)
456456
_yup_get_package_config_libs ("${package}" package_libs)
457457
list (APPEND module_libs ${package_libs})
458458
endforeach()
@@ -505,15 +505,15 @@ function (yup_add_module module_path modules_definitions module_group)
505505
endif()
506506

507507
# ==== Add module definitions
508-
foreach (module_definition ${modules_definitions})
508+
foreach (module_definition IN LISTS modules_definitions)
509509
list (APPEND module_defines ${module_definition})
510510
endforeach()
511511

512512
# ==== Prepare include paths
513513
get_filename_component (module_include_path ${module_path} DIRECTORY)
514514
list (APPEND module_include_paths "${module_include_path}")
515515

516-
foreach (searchpath ${module_searchpaths})
516+
foreach (searchpath IN LISTS module_searchpaths)
517517
if (EXISTS "${searchpath}")
518518
list (APPEND module_include_paths "${searchpath}")
519519
elseif (EXISTS "${module_path}/${searchpath}")

tests/yup_dsp/yup_BiquadFilter.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,15 @@
2525

2626
using namespace yup;
2727

28-
namespace
29-
{
30-
constexpr double tolerance = 1e-4;
31-
constexpr float toleranceF = 1e-4f;
32-
constexpr double sampleRate = 44100.0;
33-
constexpr int blockSize = 256;
34-
} // namespace
35-
3628
//==============================================================================
3729
class BiquadFilterTests : public ::testing::Test
3830
{
3931
protected:
32+
static constexpr double tolerance = 1e-4;
33+
static constexpr float toleranceF = 1e-4f;
34+
static constexpr double sampleRate = 44100.0;
35+
static constexpr int blockSize = 256;
36+
4037
void SetUp() override
4138
{
4239
filterFloat.prepare (sampleRate, blockSize);

tests/yup_dsp/yup_ButterworthFilter.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,15 @@
2525

2626
using namespace yup;
2727

28-
namespace
29-
{
30-
constexpr double tolerance = 1e-4;
31-
constexpr float toleranceF = 1e-4f;
32-
constexpr double sampleRate = 44100.0;
33-
constexpr int blockSize = 256;
34-
} // namespace
35-
3628
//==============================================================================
3729
class ButterworthFilterTests : public ::testing::Test
3830
{
3931
protected:
32+
static constexpr double tolerance = 1e-4;
33+
static constexpr float toleranceF = 1e-4f;
34+
static constexpr double sampleRate = 44100.0;
35+
static constexpr int blockSize = 256;
36+
4037
void SetUp() override
4138
{
4239
filterFloat.prepare (sampleRate, blockSize);

tests/yup_dsp/yup_FilterDesigner.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,14 @@
2525

2626
using namespace yup;
2727

28-
namespace
29-
{
30-
constexpr double tolerance = 1e-4;
31-
constexpr float toleranceF = 1e-4f;
32-
constexpr double sampleRate = 44100.0;
33-
} // namespace
34-
3528
//==============================================================================
3629
class FilterDesignerTests : public ::testing::Test
3730
{
3831
protected:
32+
static constexpr double tolerance = 1e-4;
33+
static constexpr float toleranceF = 1e-4f;
34+
static constexpr double sampleRate = 44100.0;
35+
3936
void SetUp() override
4037
{
4138
// Common test parameters
@@ -360,4 +357,4 @@ TEST_F (FilterDesignerTests, FloatPrecisionConsistency)
360357
EXPECT_NEAR (doubleCoeffs.b2, static_cast<double> (floatCoeffs.b2), toleranceF);
361358
EXPECT_NEAR (doubleCoeffs.a1, static_cast<double> (floatCoeffs.a1), toleranceF);
362359
EXPECT_NEAR (doubleCoeffs.a2, static_cast<double> (floatCoeffs.a2), toleranceF);
363-
}
360+
}

tests/yup_dsp/yup_FirstOrderFilter.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,15 @@
2525

2626
using namespace yup;
2727

28-
namespace
29-
{
30-
constexpr double tolerance = 1e-4;
31-
constexpr float toleranceF = 1e-4f;
32-
constexpr double sampleRate = 44100.0;
33-
constexpr int blockSize = 256;
34-
} // namespace
35-
3628
//==============================================================================
3729
class FirstOrderFilterTests : public ::testing::Test
3830
{
3931
protected:
32+
static constexpr double tolerance = 1e-4;
33+
static constexpr float toleranceF = 1e-4f;
34+
static constexpr double sampleRate = 44100.0;
35+
static constexpr int blockSize = 256;
36+
4037
void SetUp() override
4138
{
4239
filterFloat.prepare (sampleRate, blockSize);

tests/yup_dsp/yup_RbjFilter.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,15 @@
2525

2626
using namespace yup;
2727

28-
namespace
29-
{
30-
constexpr double tolerance = 1e-6;
31-
constexpr float toleranceF = 1e-5f;
32-
constexpr double sampleRate = 44100.0;
33-
constexpr int blockSize = 256;
34-
} // namespace
35-
3628
//==============================================================================
3729
class RbjFilterTests : public ::testing::Test
3830
{
3931
protected:
32+
static constexpr double tolerance = 1e-6;
33+
static constexpr float toleranceF = 1e-5f;
34+
static constexpr double sampleRate = 44100.0;
35+
static constexpr int blockSize = 256;
36+
4037
void SetUp() override
4138
{
4239
filterFloat.prepare (sampleRate, blockSize);

tests/yup_dsp/yup_SpectrumAnalyzerState.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@
2525

2626
using namespace yup;
2727

28-
namespace
29-
{
30-
constexpr float tolerance = 1e-6f;
31-
} // namespace
32-
3328
//==============================================================================
3429
class SpectrumAnalyzerStateTests : public ::testing::Test
3530
{
3631
protected:
32+
static constexpr float tolerance = 1e-6f;
33+
3734
void SetUp() override
3835
{
3936
analyzer = std::make_unique<SpectrumAnalyzerState>();

tests/yup_dsp/yup_StateVariableFilter.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,15 @@
2525

2626
using namespace yup;
2727

28-
namespace
29-
{
30-
constexpr double tolerance = 1e-4;
31-
constexpr float toleranceF = 1e-4f;
32-
constexpr double sampleRate = 44100.0;
33-
constexpr int blockSize = 256;
34-
} // namespace
35-
3628
//==============================================================================
3729
class StateVariableFilterTests : public ::testing::Test
3830
{
3931
protected:
32+
static constexpr double tolerance = 1e-4;
33+
static constexpr float toleranceF = 1e-4f;
34+
static constexpr double sampleRate = 44100.0;
35+
static constexpr int blockSize = 256;
36+
4037
void SetUp() override
4138
{
4239
filterFloat.prepare (sampleRate, blockSize);

tests/yup_dsp/yup_WindowFunctions.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,16 @@
2525

2626
using namespace yup;
2727

28-
namespace
29-
{
30-
constexpr double tolerance = 1e-4;
31-
constexpr float toleranceF = 1e-4f;
32-
constexpr float relaxedToleranceF = 1e-3f;
33-
constexpr int windowSize = 128;
34-
constexpr int largeWindowSize = 512;
35-
} // namespace
36-
3728
//==============================================================================
3829
class WindowFunctionsTests : public ::testing::Test
3930
{
4031
protected:
32+
static constexpr double tolerance = 1e-4;
33+
static constexpr float toleranceF = 1e-4f;
34+
static constexpr float relaxedToleranceF = 1e-3f;
35+
static constexpr int windowSize = 128;
36+
static constexpr int largeWindowSize = 512;
37+
4138
void SetUp() override
4239
{
4340
// Initialize test vectors
@@ -607,4 +604,4 @@ TEST_F (WindowFunctionsTests, TypeAliases)
607604
EXPECT_TRUE (std::isfinite (value1));
608605
EXPECT_TRUE (std::isfinite (value2));
609606
EXPECT_NEAR (value1, static_cast<float> (value2), toleranceF);
610-
}
607+
}

0 commit comments

Comments
 (0)