Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions NAM/get_dsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class Version
{
public:
Version(int major, int minor, int patch)
: major(major)
, minor(minor)
, patch(patch)
: major{major}
, minor{minor}
, patch{patch}
{
}

Expand Down
1 change: 1 addition & 0 deletions tools/run_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ int main()
test_get_dsp::test_version_patch_one_beyond_supported();
test_get_dsp::test_version_minor_one_beyond_supported();
test_get_dsp::test_version_too_early();
test_get_dsp::test_version_constructs_with_freebsd_major_minor_macros();
test_get_dsp::test_is_version_supported_core_behavior();
test_get_dsp::test_register_custom_version_support_checker();
test_get_dsp::test_get_dsp_default_allows_constructor_reset_prewarm();
Expand Down
13 changes: 13 additions & 0 deletions tools/test/test_get_dsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,26 @@

#include "json.hpp"

// FreeBSD's sys/types.h defines major(x) and minor(x) macros. Keep these
// enabled while including get_dsp.h so this test catches macro expansion in
// Version's member initializers.
#define major(x) freebsd_major(x)
#define minor(x) freebsd_minor(x)
#include "NAM/get_dsp.h"
#undef major
#undef minor
#include "NAM/registry.h"

namespace test_get_dsp
{
static_assert(std::is_base_of_v<std::runtime_error, nam::NamFileValidationError>);

void test_version_constructs_with_freebsd_major_minor_macros()
{
const nam::Version version(1, 2, 3);
assert(version.toString() == "1.2.3");
}

// Config
const std::string basicConfigStr =
R"({"version": "0.5.4", "metadata": {"date": {"year": 2024, "month": 10, "day": 9, "hour": 18, "minute": 44, "second": 41}, "loudness": -37.8406867980957, "gain": 0.13508800804658277, "name": "Test LSTM", "modeled_by": "Steve", "gear_type": "amp", "gear_make": "Darkglass Electronics", "gear_model": "Microtubes 900 v2", "tone_type": "clean", "input_level_dbu": 18.3, "output_level_dbu": 12.3, "training": {"settings": {"ignore_checks": false}, "data": {"latency": {"manual": null, "calibration": {"algorithm_version": 1, "delays": [-16], "safety_factor": 1, "recommended": -17, "warnings": {"matches_lookahead": false, "disagreement_too_high": false}}}, "checks": {"version": 3, "passed": true}}, "validation_esr": null}}, "architecture": "LSTM", "config": {"input_size": 1, "hidden_size": 3, "num_layers": 1}, "weights": [-0.21677088737487793, -0.6683622002601624, -0.2560940980911255, -0.3588429093360901, 0.17952610552310944, 0.19445613026618958, -0.01662646047770977, 0.5353694558143616, -0.2536540627479553, -0.5132213234901428, -0.020476307719945908, 0.08592455089092255, -0.6891753673553467, 0.3627359867095947, 0.008421811275184155, 0.3113192617893219, 0.14251480996608734, 0.07989779114723206, -0.18211324512958527, 0.7118963003158569, 0.41084015369415283, -0.6571938395500183, -0.13214066624641418, -0.2698603868484497, 0.49387243390083313, -0.3491725027561188, 0.6353667974472046, -0.5005152225494385, 0.2052856683731079, -0.4301638901233673, -0.15770092606544495, -0.7181791067123413, 0.056290093809366226, -0.49049463868141174, 0.6623441576957703, 0.09029324352741241, 0.34005245566368103, 0.16416560113430023, 0.15520110726356506, -0.4155678153038025, -0.36928507685661316, 0.3211132884025574, -0.6769840121269226, -0.1575538069009781, 0.05268515646457672, -0.4191459119319916, 0.599330484867096, 0.21518059074878693, -4.246325492858887, -3.315647840499878, -4.328850746154785, 4.496089458465576, 5.015639305114746, 3.6492037773132324, 0.14431169629096985, -0.6633821725845337, 0.11673200130462646, -0.1418764889240265, -0.4897872805595398, -0.8689419031143188, -0.06714004278182983, -0.4450395107269287, -0.02142983116209507, -0.15136894583702087, -2.775207996368408, -0.08681213855743408, 0.05702732503414154, 0.670292317867279, 0.31442636251449585, 0.30793967843055725], "sample_rate": 48000})";
Expand Down
Loading