-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from DanielSperry/master
Fixed problem with the restore order of variables initialized with NULL.
- Loading branch information
Showing
2 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
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
32 changes: 32 additions & 0 deletions
32
async/src/test/java/com/ea/async/test/NullThenBasicValueTest.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.ea.async.test; | ||
|
||
import com.ea.async.Task; | ||
|
||
import org.junit.Test; | ||
|
||
import static com.ea.async.Async.await; | ||
import static org.junit.Assert.assertNull; | ||
|
||
public class NullThenBasicValueTest extends BaseTest | ||
{ | ||
@Test | ||
public void nullThenBasicValueTest() throws Exception | ||
{ | ||
debugTransform(NullThenBasicValueTest.class.getName() + "$NullThenBasicVal"); | ||
final Task<Void> res = NullThenBasicVal.doIt(getBlockedTask()); | ||
completeFutures(); | ||
assertNull(res.join()); | ||
} | ||
|
||
public static class NullThenBasicVal | ||
{ | ||
public static Task<Void> doIt(Task<Void> task) | ||
{ | ||
String nullString = null; //this variable must be a string and initialized to null | ||
int basicInt = 0; //this variable must be numeric and initialized to anything | ||
|
||
await(task); | ||
return Task.done(); | ||
} | ||
} | ||
} |