Conversation
teadetime
left a comment
There was a problem hiding this comment.
Looks amazing, did a look through of it all -- need to understand the composing bit but this looks much cleaner!
| project(OlinCoin C CXX) | ||
| enable_testing() | ||
| #set(CMAKE_BUILD_TYPE Debug) | ||
| set(CMAKE_BUILD_TYPE Debug) |
|
|
||
| if (block->txs != NULL) { | ||
| for (unsigned int i = 0; i < block->num_txs; i++) | ||
| if (block->txs[i] != NULL) |
There was a problem hiding this comment.
This check isn't actually needed, it is done in free_tx
| @@ -0,0 +1,17 @@ | |||
| add_library(fixtures STATIC | |||
There was a problem hiding this comment.
interesting that the fixtures end up requiring all our base libraries
| add_subdirectory(global) | ||
| add_subdirectory(txs) | ||
| add_subdirectory(utils) | ||
| add_subdirectory(fixtures) |
There was a problem hiding this comment.
I think you handled the cmake stuff very cleanly here
| @@ -0,0 +1,66 @@ | |||
| #include "fixtures_block.h" | |||
| } | ||
|
|
||
| int fixture_setup_utxo_to_tx(void **state) { | ||
| utxo_to_tx_init(); |
There was a problem hiding this comment.
Pretty sure this is done in mempool init...
| composition = *state; | ||
| *state = NULL; | ||
|
|
||
| int i = 0; |
There was a problem hiding this comment.
Unclear what composing means or composed fixture (Very small comments in the headers might clear this up)
| sub_state = malloc(sizeof(void*) * 2); | ||
| fixture_setup_unlinked_tx(&sub_state[0]); | ||
| fixture_setup_unlinked_keypair(&sub_state[1]); | ||
| *state = sub_state; |
There was a problem hiding this comment.
single pointer being set to a double pointer -> not sure what is actually happening here
| return NULL; | ||
| static void test_utxo_pool_init(void **state) { | ||
| (void)state; | ||
| assert_ptr_not_equal(utxo_pool_db, NULL); |
There was a problem hiding this comment.
Think we may have discused that we should not check leveldb to Null, maybe we test the init funciton for a valid return ?
Closes #32, Closes #52
In progress, moving tests over to CMocka fixture based structure.