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

Fix LocalOut check #2657

Merged

Conversation

telephon
Copy link
Member

A test:

{ LocalOut.kr(0) }.asSynthDef; // works
{ LocalOut.kr([0]) }.asSynthDef; // works
{ LocalOut.kr() }.asSynthDef; // fails
{ LocalOut.kr([]) }.asSynthDef; // fails

The size of the inputs depends on the number of fixed args.
@telephon
Copy link
Member Author

With the following test, I found one more incorrectness. I'll address it in another PR:



(
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
)

Copy link
Contributor

@mossheim mossheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works for me with the test cases you gave. Could we perhaps adapt your more rigorous test code as a unit test when you make the new PR?

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 61d45ad into supercollider:master Feb 3, 2017
@mossheim
Copy link
Contributor

mossheim commented Feb 3, 2017

Did this fix any open issues? I can't find any.

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