Opened 16 years ago
Closed 16 years ago
#117 closed defect (fixed)
Problems with tests and use of static data
| Reported by: | Stephen Siegel | Owned by: | ywei |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | test | Version: | 1.0 |
| Keywords: | Cc: |
Description
The tests are all getting their parameters from the static fields of ExecConfig. This class is only loaded once by the JVM. So the values set by the previous test are in effect when the next test runs.
Using static data in this way is not a good idea. The data should be encapsulated in an object which is passed around as an argument. For a quick fix, you can just make sure to re-set everything in the static class before each test.
Also, buffer bounds should always be positive for any program that does message passing. The command line already checks for this, but the tests bypass the command line. So correct all tests to use positive buffer bound in case of message passing programs.
Change History (4)
comment:1 by , 16 years ago
| Owner: | set to |
|---|---|
| Status: | new → accepted |
comment:2 by , 16 years ago
comment:3 by , 16 years ago
On a second thought, I think I will just change the CreateConfig to make it create a new ExecConfig instance every time it is called. That may keep the things we need to change as minimal as possible.
comment:4 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
Bug fixed. The configuration information now change correctly by the settings.

The configuration data is encapsulate in the ExecConfig object. Since this class use a singleton patter, the users need to call the reset() method if they want to get a new configuration. After that they can use the CreateConfig method to create a new ExecConfig. I will fix the tests.