Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class library: XOut uses correct input test #2659

Merged
merged 1 commit into from
Feb 3, 2017

Conversation

telephon
Copy link
Member

This is the test that was explicitly defined in the superclass for that
purpose, so use this.



(
var failing = [nil, []];
var working = [0, [0], [0, 0, 0]];
var stubs = [
	{ |args| LocalOut.kr(*args) },
	{ |args| Out.kr(0, *args) },
	{ |args| ReplaceOut.kr(0, *args) },
	{ |args| XOut.kr(0, 0.5, *args) },
];

var fails = failing.every { |input|
	stubs.every { |func|
		var fails = false;
		try { { func.(input) }.asSynthDef } { |err| fails = err.isException };
		if(fails.not) { "This is a case that should have failed:\n%\nOn this input:\n%\n".postf(func.cs, input) };
		fails
	}
};
var works = working.every { |input|
	stubs.every { |func|
		var works = true;
		try { { func.(input) }.asSynthDef } { |err| works = err.isException.not };
		if(works.not) { "This is a case that should not have failed:\n%\nOn this input:\n%\n".postf(func.cs, input) };
		works
	}
};

fails and: works
)

This is the test that was explicitly defined in the superclass for that
purpose, so use this.
@telephon
Copy link
Member Author

The audio rate tests:


(
var failing = [nil, []];
var working = [{DC.ar(0)}, {DC.ar([0, 0])}];
var stubs = [
	{ |args| LocalOut.ar(*args) },
	{ |args| Out.ar(0, *args) },
	{ |args| ReplaceOut.ar(0, *args) },
	{ |args| XOut.ar(0, 0.5, *args) },
];

var fails = failing.every { |input|
	stubs.every { |func|
		var fails = false;
		try { { func.(input) }.asSynthDef } { |err| fails = err.isException };
		if(fails.not) { "This is a case that should have failed:\n%\nOn this input:\n%\n".postf(func.cs, input) };
		fails
	}
};
var works = working.every { |input|
	stubs.every { |func|
		var works = true;
		try { { func.(input) }.asSynthDef } { |err| works = err.isException.not };
		if(works.not) { "This is a case that should not have failed:\n%\nOn this input:\n%\n".postf(func.cs, input) };
		works
	}
};

fails and: works
)

telephon added a commit to telephon/supercollider that referenced this pull request Jan 18, 2017
Will only work after supercollider#2657 and supercollider#2659 have been merged.
@telephon telephon mentioned this pull request Jan 18, 2017
@mossheim
Copy link
Contributor

mossheim commented Feb 2, 2017

As stated in #2664, ready to merge once changes are made.

@mossheim mossheim merged commit a2b558a into supercollider:master Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants