History

updated tests

Ge Wang committed 3 years ago

Commit 3a080481 parent 046d46f6 files · +68 −14Browse files

Unified · Split

6 files
  1. src/test/01-Basic/118.ck +1 −1
  2. src/test/01-Basic/120.ck +1 −1
  3. src/test/01-Basic/123.ck +1 −1
  4. src/test/01-Basic/124.ck +1 −1
  5. src/test/01-Basic/125.ck +44 −10
  6. src/test/01-Basic/127.ck +20 −0
src/test/01-Basic/118.ck+1−1
@@ -1,5 +1,5 @@
11 // testing Math.euclidean, which has three overloaded variants
2−// added 1.4.2.1
2+// added 1.5.0.0
33
44 @(0,0,0) => vec3 a;
55 @(1,1,1) => vec3 b;
src/test/01-Basic/120.ck+1−1
@@ -14,7 +14,7 @@ fun vec3 hasReturn() · 13 unmodified lines
1414 // like vec3
1515 <<< hasReturn(), missingReturn() >>>;
1616
17−// before the fix in 1.4.2.1, the above would incorrectly print
17+// before the fix in 1.5.0.0, the above would incorrectly print
1818 // #(0.0000,0.0000,1.0000) #(0.0000,0.0000,0.0000)
1919 // this implies the stack pointer is off, due to missingReturn
2020 // not accounting for the size of its return type, vec3
src/test/01-Basic/123.ck+1−1
@@ -1,4 +1,4 @@
1−// test args pass through | 1.4.2.1 (ge) added
1+// test args pass through | 1.5.0.0 (ge) added
22
33 // make a SndBuf
44 SndBuf buf => dac;
src/test/01-Basic/124.ck+1−1
@@ -1,4 +1,4 @@
1−// testing for filter blowup | 1.4.2.1 (ge) added
1+// testing for filter blowup | 1.5.0.0 (ge) added
22 // NOTE: intended to be run with --silent
33 //
44 // filter explosions observed, before this commit d53cdfb
src/test/01-Basic/125.ck+44−10
@@ -1,16 +1,50 @@
1+// testing for filter blowup | 1.5.0.0 (ge) added
2+// NOTE: intended to be run with --silent
3+//
4+// filter explosions observed, before this commit d53cdfb
5+// https://github.com/ccrma/chuck/commit/d53cdfbf448c1c52a760fc2769e94204ad3a6f4d
6+//
7+// macOS (64-bit, macOS Venture)
8+// *** BLOW UP at time: 19.815533 value: 100.037407 freq: 0.100000 Q: 7.844161
9+// linux (64-bit, planetCCRMA)
10+// *** BLOW UP at time: 33.817312 value: 100.002319 freq: 0.100000 Q: 1.309424
11+// windows (32-bit and 64-bit, windows 10)
12+// *** BLOW UP at time: 18.635624 value: 100.004440 freq: 0.100000 Q: 9.886994
13+//
14+// author: Ge Wang
15+// date: Winter 2023
116
2−[1,2,3,4,5] @=> int a[];
3−Math.srandom(11);
4−a.shuffle();
17+// blackhole for maximum safety from filter explosion
18+Step n => HPF f => blackhole;
519
6−[1,2,3,4,5] @=> int b[];
7−Math.srandom(11);
8−b.shuffle();
20+// sus
21+30000 => f.freq;
22+// set step function
23+1 => n.next;
24+// did we detect blow up
25+false => int blowup;
926
10−for( int i; i < a.size(); i++ )
27+// later
28+now + 50::second => time later;
29+// go until later
30+while( now < later )
1131 {
12− if( a[i] != b[i] ) me.exit();
32+ // sweep Q
33+ .5 + 10*(1+Math.sin(now/second))/2 => f.Q;
34+ 1::samp => now;
35+
36+ // consider this a blow up
37+ if( f.last() > 100 )
38+ {
39+ // note
40+ <<< "*** BLOW UP at time:", now/second, "value:", f.last(),
41+ "freq:", f.freq(), "Q:", f.Q() >>>;
42+ // flag
43+ true => blowup;
44+ // bail
45+ break;
46+ }
1347 }
1448
15−// got here, good
16−<<< "success" >>>;
49+// no blow up? great
50+if( !blowup ) <<< "success" >>>;
src/test/01-Basic/127.ck+20−0
@@ -0,0 +1,20 @@
1+// 1.5.0.0 | (ge)
2+// testing random seed with shuffle
3+
4+[1,2,3,4,5] @=> int a[];
5+Math.srandom(11);
6+a.shuffle();
7+
8+[1,2,3,4,5] @=> int b[];
9+Math.srandom(11);
10+b.shuffle();
11+
12+// compare
13+for( int i; i < a.size(); i++ )
14+{
15+ // if different
16+ if( a[i] != b[i] ) me.exit();
17+}
18+
19+// got here, good
20+<<< "success" >>>;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t