summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/block_task.cpp7
-rw-r--r--lib/input_handlers.cpp1
-rw-r--r--tests/CMakeLists.txt2
-rw-r--r--tests/query_test.py (renamed from tests/stats_test.py)4
4 files changed, 11 insertions, 3 deletions
diff --git a/lib/block_task.cpp b/lib/block_task.cpp
index 87d0c8a..21986fc 100644
--- a/lib/block_task.cpp
+++ b/lib/block_task.cpp
@@ -36,6 +36,13 @@ void BlockActor::mark_done(void)
this->input_queues.flush_all();
this->output_queues.flush_all();
+ //release all tags and msgs
+ for (size_t i = 0; i < this->get_num_inputs(); i++)
+ {
+ this->input_msgs[i].clear();
+ this->input_tags[i].clear();
+ }
+
//tell the upstream and downstram to re-check their tokens
//this is how the other blocks know who is interested,
//and can decide based on interest to set done or not
diff --git a/lib/input_handlers.cpp b/lib/input_handlers.cpp
index e3b5203..27704fe 100644
--- a/lib/input_handlers.cpp
+++ b/lib/input_handlers.cpp
@@ -12,6 +12,7 @@ void BlockActor::handle_input_tag(const InputTagMessage &message, const Theron::
const size_t index = message.index;
//handle incoming stream tag, push into the tag storage
+ if (this->block_state == BLOCK_STATE_DONE) return;
this->input_tags[index].push_back(message.tag);
this->input_tags_changed[index] = true;
}
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 516dd79..7626eb0 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -43,5 +43,5 @@ GR_ADD_TEST(block_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/block_te
GR_ADD_TEST(hier_block_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/hier_block_test.py)
GR_ADD_TEST(thread_pool_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/thread_pool_test.py)
GR_ADD_TEST(sbuffer_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/sbuffer_test.py)
-GR_ADD_TEST(stats_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/stats_test.py)
+GR_ADD_TEST(query_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/query_test.py)
GR_ADD_TEST(block_props_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/block_props_test.py)
diff --git a/tests/stats_test.py b/tests/query_test.py
index 1c4ff5e..0326d33 100644
--- a/tests/stats_test.py
+++ b/tests/query_test.py
@@ -5,7 +5,7 @@ import gras
import numpy
from demo_blocks import *
-class StatsTest(unittest.TestCase):
+class QueryTest(unittest.TestCase):
def setUp(self):
self.tb = gras.TopBlock()
@@ -22,7 +22,7 @@ class StatsTest(unittest.TestCase):
self.assertEqual(vec_sink.get_vector(), (0, 9, 8, 7, 6))
- print self.tb.get_stats("")
+ print self.tb.query("")
if __name__ == '__main__':
unittest.main()