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 @@
1// testing Math.euclidean, which has three overloaded variants1// testing Math.euclidean, which has three overloaded variants
2// added 1.4.2.12// added 1.5.0.0
3 3
4@(0,0,0) => vec3 a;4@(0,0,0) => vec3 a;
5@(1,1,1) => vec3 b;5@(1,1,1) => vec3 b;
src/test/01-Basic/120.ck+1−1
@@ -14,7 +14,7 @@ fun vec3 hasReturn() · 13 unmodified lines
14// like vec314// like vec3
15<<< hasReturn(), missingReturn() >>>;15<<< hasReturn(), missingReturn() >>>;
16 16
17// before the fix in 1.4.2.1, the above would incorrectly print17// before the fix in 1.5.0.0, the above would incorrectly print
18// #(0.0000,0.0000,1.0000) #(0.0000,0.0000,0.0000)18// #(0.0000,0.0000,1.0000) #(0.0000,0.0000,0.0000)
19// this implies the stack pointer is off, due to missingReturn19// this implies the stack pointer is off, due to missingReturn
20// not accounting for the size of its return type, vec320// 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) added1// test args pass through | 1.5.0.0 (ge) added
2 2
3// make a SndBuf3// make a SndBuf
4SndBuf buf => dac;4SndBuf buf => dac;
src/test/01-Basic/124.ck+1−1
@@ -1,4 +1,4 @@
1// testing for filter blowup | 1.4.2.1 (ge) added1// testing for filter blowup | 1.5.0.0 (ge) added
2// NOTE: intended to be run with --silent2// NOTE: intended to be run with --silent
3//3//
4// filter explosions observed, before this commit d53cdfb4// 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
1 16
2[1,2,3,4,5] @=> int a[];17// blackhole for maximum safety from filter explosion
3Math.srandom(11);18Step n => HPF f => blackhole;
4a.shuffle();
5 19
6[1,2,3,4,5] @=> int b[];20// sus
7Math.srandom(11);2130000 => f.freq;
8b.shuffle();22// set step function
231 => n.next;
24// did we detect blow up
25false => int blowup;
9 26
10for( int i; i < a.size(); i++ )27// later
28now + 50::second => time later;
29// go until later
30while( now < later )
11{31{
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 }
13}47}
14 48
15// got here, good49// no blow up? great
16<<< "success" >>>;50if( !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[];
5Math.srandom(11);
6a.shuffle();
7
8[1,2,3,4,5] @=> int b[];
9Math.srandom(11);
10b.shuffle();
11
12// compare
13for( 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