mirror of
https://github.com/logos-blockchain/logos-blockchain-module.git
synced 2026-08-09 15:53:14 +00:00
Add missing tests stubs
This commit is contained in:
parent
f408429a55
commit
5a4241a0cc
@ -12,6 +12,7 @@ logos_test(
|
|||||||
TEST_SOURCES
|
TEST_SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
test_blockchain.cpp
|
test_blockchain.cpp
|
||||||
|
event_stubs.cpp
|
||||||
MOCK_C_SOURCES
|
MOCK_C_SOURCES
|
||||||
mocks/mock_logos_blockchain.cpp
|
mocks/mock_logos_blockchain.cpp
|
||||||
EXTRA_INCLUDES
|
EXTRA_INCLUDES
|
||||||
@ -35,6 +36,7 @@ if(LIBLOGOS_BLOCKCHAIN_PATH)
|
|||||||
TEST_SOURCES
|
TEST_SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
test_blockchain.cpp
|
test_blockchain.cpp
|
||||||
|
event_stubs.cpp
|
||||||
EXTRA_INCLUDES
|
EXTRA_INCLUDES
|
||||||
../lib
|
../lib
|
||||||
EXTRA_LINK_LIBS
|
EXTRA_LINK_LIBS
|
||||||
|
|||||||
17
tests/event_stubs.cpp
Normal file
17
tests/event_stubs.cpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Test-only definitions for `logos_events:` methods.
|
||||||
|
//
|
||||||
|
// In a real build the cpp-generator emits the bodies of every `logos_events:`
|
||||||
|
// method into a sidecar `<name>_events.cpp` (each forwards through
|
||||||
|
// `emitEventImpl_`). The unit/integration test targets compile the module
|
||||||
|
// source directly without running codegen, so those bodies are absent and the
|
||||||
|
// link fails on `on_new_block_callback`'s reference to `newBlock`.
|
||||||
|
//
|
||||||
|
// `emitEventImpl_` is a no-op outside a framework-provisioned context (no emit
|
||||||
|
// callback is installed in tests), so forwarding here mirrors production
|
||||||
|
// behaviour while keeping the test build link-complete.
|
||||||
|
|
||||||
|
#include "logos_blockchain_module.h"
|
||||||
|
|
||||||
|
void LogosBlockchainModule::newBlock(const std::string& blockJson) {
|
||||||
|
emitEventImpl_("newBlock", nullptr);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user