forked from supercollider-quarks/CommonTests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestEnv.sc
More file actions
29 lines (21 loc) · 744 Bytes
/
TestEnv.sc
File metadata and controls
29 lines (21 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
Env.test
UnitTest.gui
*/
TestEnv : UnitTest {
test_equality {
var a,b,c;
a = Env([ 0, 1.0, 1.0, 0 ], [ 0.01, 1.0, 1.0 ], 'lin', nil, nil);
b = Env([ 0, 1.0, 1.0, 0 ], [ 0.01, 1.0, 1.0 ], 'lin', nil, nil);
c = Env([ 0, 2.0, 1.0, 0 ], [ 0.01, 1.0, 1.0 ], 'lin', nil, nil);
this.assert( a == b, "2 identically specified Envs should be equal");
this.assert( a != c, "2 different Envs should not be equal");
this.assert( a == a, "an Env should equal itself");
}
test_equivalences {
this.assertArrayFloatEquals(
Env.cutoff(1, 1, 'exp').asSignal(20).as(Array),
Env.cutoff(1, 1, 'lin').asSignal(20).asArray.linexp(0,1,-100.dbamp,1),
"Exponential Env.cutoff should be same as linear Env.cutoff.linexp");
}
}