Skip to content

Commit

Permalink
[libc] refs #105 Repair error in compare GoString_ to GoString in `Te…
Browse files Browse the repository at this point in the history
…stBitcoinAddress`
  • Loading branch information
Maykel Arias Torres committed Sep 11, 2019
1 parent b9ed13f commit bc876e3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/cgo/tests/check_cipher.bitcoin.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,16 @@ START_TEST(TestBitcoinAddress)
error = SKY_cipher_PubKeyFromHex(*pubKeyStr, &pubkey);
ck_assert_msg(error == SKY_OK, "Create PubKey from Hex");

GoString_ str = {NULL, 0};
GoString str = {NULL, 0};
SKY_cipher_BitcoinAddressFromPubKey(&pubkey, &btcAddr);
SKY_cipher_BitcoinAddress_String(&btcAddr, &str);
registerMemCleanup((void*)str.p);
GoString tmpStr = {str.p, str.n};
ck_assert_str_eq(str.p, addrStr->p);
ck_assert(isGoStringEq(*addrStr, str));

error = SKY_cipher_BitcoinAddressFromSecKey(&seckey, &btcAddr);
ck_assert(error == SKY_OK);
GoString_ tmpstr = {buff, 0};
SKY_cipher_BitcoinAddress_String(&btcAddr, &tmpstr);
ck_assert_str_eq(tmpStr.p, addrStr->p);
SKY_cipher_BitcoinAddress_String(&btcAddr, &str);
ck_assert(isGoStringEq(*addrStr, str));
}
}
END_TEST
Expand Down

0 comments on commit bc876e3

Please sign in to comment.