store files for tests in the fdroid cache

For some reason, on some emulators, it is failing to find a place to write
the test index files.  But on most setups, it works fine.  So instead try
writing the files to the cacheDir of FDroid itself rather than the test app
This commit is contained in:
Hans-Christoph Steiner 2014-05-01 21:44:27 -04:00
parent b8cffa6744
commit f483630e02

View File

@ -44,7 +44,8 @@ public class SignedRepoUpdaterTest extends InstrumentationTestCase {
InputStream input = null;
OutputStream output = null;
try {
indexFile = File.createTempFile("index-", ".xml", context.getFilesDir());
indexFile = File.createTempFile("index-", ".xml",
getInstrumentation().getTargetContext().getCacheDir());
input = getInputStreamFromAssets(fileName);
output = new FileOutputStream(indexFile);
Utils.copy(input, output);