fix the windows test failures from crlf converted resources and a directory that cannot deny removal

This commit is contained in:
Craig Raw
2026-08-27 13:09:06 +02:00
parent ffc1221e80
commit 8871f4f1af
3 changed files with 7 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
src/test/resources/** -text
+1 -1
Submodule drongo updated: b36afb7309...080cf3f7cf
@@ -1,6 +1,7 @@
package com.sparrowwallet.sparrow.net;
import com.sparrowwallet.drongo.Network;
import com.sparrowwallet.drongo.OsType;
import com.sparrowwallet.drongo.protocol.BlockHeader;
import com.sparrowwallet.drongo.protocol.HeaderCheckpoints;
import com.sparrowwallet.drongo.protocol.Sha256Hash;
@@ -27,6 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
/**
* The header store on regtest, whose trivial proof of work target is the only one a synthetic chain can be mined against, and whose empty checkpoints
@@ -244,6 +246,9 @@ public class HeaderStoreTest {
*/
@Test
public void loadsAStoreThatCannotBeDeleted() throws IOException {
//Windows has no way to deny the removal: setWritable(false) is refused on a directory, and the read only attribute would not stop a delete in any case
assumeFalse(OsType.getCurrent() == OsType.WINDOWS);
BlockHeader foreign = new BlockHeader(1, Sha256Hash.wrap("00000000000000000000000000000000000000000000000000000000deadbeef"),
Sha256Hash.ZERO_HASH, null, 1600000000L, 0x207fffffL, 0);
writeStoreFile("1", List.of(foreign));