Mercurial > hg > tc-symbol-server
changeset 15:37172df1b16e
check written 'srcsrv' stream content
author | Evgeniy.Koshkin |
---|---|
date | Wed, 31 Jul 2013 11:45:40 +0400 |
parents | 5856cab1ca05 |
children | 7dec02710a42 |
files | agent/src/jetbrains/buildServer/symbols/PdbFilePatcher.java tests/src/PdbFilePatcherTest.java |
diffstat | 2 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/agent/src/jetbrains/buildServer/symbols/PdbFilePatcher.java Wed Jul 31 11:38:03 2013 +0400 +++ b/agent/src/jetbrains/buildServer/symbols/PdbFilePatcher.java Wed Jul 31 11:45:40 2013 +0400 @@ -3,7 +3,6 @@ import jetbrains.buildServer.util.FileUtil; import java.io.File; -import java.io.IOException; import java.util.Collection; /** @@ -22,11 +21,14 @@ myIndexInputProvider = indexInputProvider; } - public void patch(File symbolsFile) throws IOException { + public void patch(File symbolsFile) throws Exception { final Collection<File> sourceFiles = mySrcToolExe.getReferencedSourceFiles(symbolsFile); - final File tmpFile = FileUtil.createTempFile(myHomeDir, "pdb-patch", ".xml", false); + final File tmpFile = FileUtil.createTempFile(myHomeDir, "pdb-", ".patch", false); myIndexInputProvider.dumpStreamToFile(tmpFile, sourceFiles); myPdbStrExe.doCommand(PdbStrExeCommand.WRITE, symbolsFile, tmpFile, PdbStrExe.SRCSRV_STREAM_NAME); - //TODO: check that data was actually written + final File tmpFile1 = FileUtil.createTempFile(myHomeDir, "pdb-", ".patch", false); + myPdbStrExe.doCommand(PdbStrExeCommand.READ, symbolsFile, tmpFile1, PdbStrExe.SRCSRV_STREAM_NAME); + if(!FileUtil.checkContentEqual(tmpFile, tmpFile1)) + throw new Exception("'srcsrv' stream content written to pdb differs from initial one"); } }
--- a/tests/src/PdbFilePatcherTest.java Wed Jul 31 11:38:03 2013 +0400 +++ b/tests/src/PdbFilePatcherTest.java Wed Jul 31 11:45:40 2013 +0400 @@ -25,7 +25,7 @@ } @Test - public void testFoo() throws IOException { + public void testFoo() throws Exception { File tempFile = new File(myTestHomeDir, "tmp.pdb"); FileUtil.copy(new File("c:\\temp\\JetBrains.CommandLine.Symbols.pdb"), tempFile); myPatcher.patch(tempFile);