Skip to content

Commit

Permalink
Simple cruft removal (#36)
Browse files Browse the repository at this point in the history
- Not very critical as it is a test file.

Signed-off-by: kcw-grunt <[email protected]>
  • Loading branch information
kcw-grunt committed Nov 25, 2023
1 parent 1a15ac0 commit a5ee1d8
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions test.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@
#define _va_rest(first, ...) __VA_ARGS__
#endif

<<<<<<< HEAD
#if LITECOIN_TESTNET
=======
#if BITCOIN_TESTNET
>>>>>>> origin/main
#define BR_CHAIN_PARAMS BRTestNetParams
#else
#define BR_CHAIN_PARAMS BRMainNetParams
Expand Down Expand Up @@ -170,13 +166,6 @@ int BRArrayTests()
return r;
}

//inline static int compare_int(void *info, const void *a, const void *b)
//{
// if (*(int *)a < *(int *)b) return -1;
// if (*(int *)a > *(int *)b) return 1;
// return 0;
//}

inline static size_t hash_int(const void *i)
{
return (size_t)((0x811C9dc5 ^ *(const unsigned *)i)*0x01000193); // (FNV_OFFSET xor i)*FNV_PRIME
Expand Down Expand Up @@ -332,20 +321,10 @@ int BRBech32Tests()
char h[84];
char *s, addr[91];
size_t l;
<<<<<<< HEAD

=======

>>>>>>> origin/main
s = "\x00\x14\x75\x1e\x76\xe8\x19\x91\x96\xd4\x54\x94\x1c\x45\xd1\xb3\xa3\x23\xf1\x43\x3b\xd6";
l = BRBech32Decode(h, b, "BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4");
if (l != 22 || strcmp(h, "bc") || memcmp(s, b, l))
r = 0, fprintf(stderr, "\n***FAILED*** %s: BRBech32Decode() test 1", __func__);
<<<<<<< HEAD

=======

>>>>>>> origin/main
l = BRBech32Decode(h, b, "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4");
if (l != 22 || strcmp(h, "bc") || memcmp(s, b, l))
r = 0, fprintf(stderr, "\n***FAILED*** %s: BRBech32Decode() test 2", __func__);
Expand Down Expand Up @@ -1635,26 +1614,13 @@ int BRBIP32SequenceTests()
"banner amused fringe fox insect roast aunt prefer hollow basic ladder", NULL);
BRBIP32BitIDKey(&key, dk.u8, sizeof(dk), 0, "http://bitid.bitcoin.blue/callback");
BRKeyAddress(&key, addr.s, sizeof(addr));
<<<<<<< HEAD
#if LITECOIN_TESTNET
=======
#if BITCOIN_TESTNET
>>>>>>> origin/main
if (strncmp(addr.s, "mxZ2Dn9vcyNeKh9DNHZw6d6NrxeYCVNjc2", sizeof(addr)) != 0)
r = 0, fprintf(stderr, "***FAILED*** %s: BRBIP32BitIDKey() test\n", __func__);
#else
if (strncmp(addr.s, "1J34vj4wowwPYafbeibZGht3zy3qERoUM1", sizeof(addr)) != 0)
r = 0, fprintf(stderr, "***FAILED*** %s: BRBIP32BitIDKey() test\n", __func__);
#endif
<<<<<<< HEAD

=======

>>>>>>> origin/main
// TODO: XXX test BRBIP32SerializeMasterPrivKey()
// TODO: XXX test BRBIP32SerializeMasterPubKey()

printf(" ");
return r;
}

Expand Down Expand Up @@ -1825,7 +1791,6 @@ int BRTransactionTests()
BRTransactionFree(tgt);
BRTransactionFree(src);

<<<<<<< HEAD
BRTransaction *src = BRTransactionNew ();
BRTransactionAddInput(src, inHash, 0, 1, script, scriptLen, NULL, 0, TXIN_SEQUENCE);
BRTransactionAddInput(src, inHash, 0, 1, script, scriptLen, NULL, 0, TXIN_SEQUENCE);
Expand All @@ -1851,8 +1816,6 @@ int BRTransactionTests()
BRTransactionFree(tgt);
BRTransactionFree(src);

=======
>>>>>>> origin/main
if (! r) fprintf(stderr, "\n ");
return r;
}
Expand Down Expand Up @@ -2193,16 +2156,6 @@ int BRMerkleBlockTests()
if (! UInt256Eq(txHashes[3], uint256("c9ab658448c10b6921b7a4ce3021eb22ed6bb6a7fde1e5bcc4b1db6615c6abc5")))
r = 0, fprintf(stderr, "***FAILED*** %s: BRMerkleBlockTxHashes() test 4\n", __func__);

// TODO: test a block with an odd number of tree rows both at the tx level and merkle node level

// TODO: XXX test BRMerkleBlockVerifyDifficulty()

// TODO: test (CVE-2012-2459) vulnerability
<<<<<<< HEAD

=======

>>>>>>> origin/main
BRMerkleBlock *c = BRMerkleBlockCopy(b);

if (!BRMerkleBlockEqual(b, c))
Expand Down Expand Up @@ -2584,11 +2537,7 @@ int BRPaymentProtocolEncryptionTests()

BRKeySetSecret(&senderKey, &uint256("0000000000000000000000000000000000000000000000000000000000000001"), 1);
BRKeySetSecret(&receiverKey, &uint256("0000000000000000000000000000000000000000000000000000000000000002"), 1);
<<<<<<< HEAD

=======

>>>>>>> origin/main
BRPaymentProtocolInvoiceRequest *req = BRPaymentProtocolInvoiceRequestNew(&senderKey, 0, NULL, NULL, 0, NULL, NULL,
NULL, 0);

Expand Down

0 comments on commit a5ee1d8

Please sign in to comment.