-
Notifications
You must be signed in to change notification settings - Fork 4
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
Resolve #88 #116
Merged
Merged
Resolve #88 #116
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This took a couple hours to figure out. The compiler kept telling me things that weren't allowed. The problem was I was trying to pass one of the channels in the `outputs` array, but the compiler couldn't tell if more than one future was mutably accessing the same element. The trick was to pair the output channel with the program so that iterating through the entries guaranteed each future contained a unique element.
I think this code change is correct, but I'd like to be sure, so I'm going to try to write some units tests before merging it. |
This commit introduces an "Emulator" type that provides a test harness for logic blocks. Three units tests have been added using this harness: - One that tests a logic block that forwards an input to an output. - One that forwards a calculation to an output and - One that forwards an input to two outputs. This test gives some proof that this development branch actually allows concurrency when updating more than one expression.
The output device map isn't lining up with the expressions. In other words, it's possible for a computed value to go to the wrong output.
We actually sort the expression list to be in index-ascending order so the target of the expressions matches the index of the setting channel.
Finally added a harness to test the logic blocks and they discovered a bug! 🎉 However, there are a few more tests I need to add:
|
Before the logic block starts initializing itself, it validates the parameters. Tests were added to confirm they work.
It was a diagnostic message. But now we have unit tests to confirm things are working.
The emulator now waits for the exit signal AND looks to see if the logic block exits. If it exits, the error value is returned. This allows us to write more specific tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request will close issue #88.