diff options
| author | chick | 2019-08-01 09:21:52 -0700 |
|---|---|---|
| committer | chick | 2019-08-01 10:52:22 -0700 |
| commit | 54e67889f10b39323fb729808b8cd22b4c832910 (patch) | |
| tree | 4b5916fe8e6cee619ab5dfc3549bfb625b5b8214 /src/test/scala/firrtlTests/ReplSeqMemTests.scala | |
| parent | 86d2470d8294a4dba37d33ba021558ba33da4d65 (diff) | |
Followup to PR #1142
Fixes a threading bug in where lazy reading of file
caused a problem for multithreaded access to the that was read.
Changes all uses of io.Source to use new API
getText
getLines
getTextResource
getLinesResouce
Make style to only import FileUtils and not its methods
So code is more explicit as e.g. FileUtils.getText()
Diffstat (limited to 'src/test/scala/firrtlTests/ReplSeqMemTests.scala')
| -rw-r--r-- | src/test/scala/firrtlTests/ReplSeqMemTests.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/scala/firrtlTests/ReplSeqMemTests.scala b/src/test/scala/firrtlTests/ReplSeqMemTests.scala index a1f27958..9a5a2f72 100644 --- a/src/test/scala/firrtlTests/ReplSeqMemTests.scala +++ b/src/test/scala/firrtlTests/ReplSeqMemTests.scala @@ -7,6 +7,7 @@ import firrtl.ir._ import firrtl.passes._ import firrtl.transforms._ import firrtl.passes.memlib._ +import firrtl.FileUtils import annotations._ import FirrtlCheckers._ @@ -29,8 +30,7 @@ class ReplSeqMemSpec extends SimpleTransformSpec { def checkMemConf(filename: String, mems: Set[MemConf]) { // Read the mem conf - val file = scala.io.Source.fromFile(filename) - val text = try file.mkString finally file.close() + val text = FileUtils.getText(filename) // Verify that this does not throw an exception val fromConf = MemConf.fromString(text) // Verify the mems in the conf are the same as the expected ones |
