Skip to content

Commit

Permalink
wip adding until into expectations (LISTEN) #69
Browse files Browse the repository at this point in the history
this also lead to completing #42 as we now pre-check
carriers before matching expectation patterns

also the led to adding carriers into the protocol step
  • Loading branch information
zippy committed Nov 14, 2015
1 parent 295f0f3 commit bae6d60
Show file tree
Hide file tree
Showing 20 changed files with 571 additions and 522 deletions.
4 changes: 3 additions & 1 deletion .ackrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
--ignore-dir=html
--ignore-dir=html
--ignore-dir=archive
--ignore-dir=csharp-ide
2 changes: 1 addition & 1 deletion doxy/sys_processes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<tr><td><a name="ITERATE"></a>ITERATE</td><td><ol><li>condtion(PROCESS:<a href="ref_sys_symbols.html#BOOLEAN">BOOLEAN</a>)</li><li>do(ANY:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</li></ol></td><td>result(PASSTHRU:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</td><td><i>iterate a process</i><br /> this process checks the structure of the result of the "condition" param, if it's a BOOLEAN, it treats the iteration as a while loop and iterates until the BOOLEAN is false; if it's an INTEGER it treats the iteration as repeat loop and iterates as many times as the value of the INTEGER</td></tr>
<tr><td><a name="SAY"></a>SAY</td><td><ol><li>to(SYMBOL:<a href="ref_sys_symbols.html#RECEPTOR_ADDRESS">RECEPTOR_ADDRESS</a>)</li><li>on(SYMBOL:<a href="ref_sys_symbols.html#ASPECT">ASPECT</a>)</li><li>message(ANY:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</li></ol></td><td>signal id(SYMBOL:<a href="ref_sys_symbols.html#SIGNAL_UUID">SIGNAL_UUID</a>)</td><td><i>send a message to a receptor</i></td></tr>
<tr><td><a name="REQUEST"></a>REQUEST</td><td><ol><li>of(SYMBOL:<a href="ref_sys_symbols.html#RECEPTOR_ADDRESS">RECEPTOR_ADDRESS</a>)</li><li>on(SYMBOL:<a href="ref_sys_symbols.html#ASPECT">ASPECT</a>)</li><li>message(ANY:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</li><li>respond on(SYMBOL:<a href="ref_sys_symbols.html#RESPONSE_CARRIER">RESPONSE_CARRIER</a>)</li><li>[until(SYMBOL:<a href="ref_sys_symbols.html#END_CONDITIONS">END_CONDITIONS</a>)]</li><li>[callback(PROCESS:<a href="ref_sys_symbols.html#NULL_SYMBOL">NULL_SYMBOL</a>)]</li></ol></td><td>response(ANY:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</td><td><i>send a request to a receptor</i><br /> if there is no "callback" param, then this process will block until the result comes back or the "until" causes cleanup of pending request.</td></tr>
<tr><td><a name="LISTEN"></a>LISTEN</td><td><ol><li>on(SYMBOL:<a href="ref_sys_symbols.html#ASPECT">ASPECT</a>)</li><li>for(SYMBOL:<a href="ref_sys_symbols.html#CARRIER">CARRIER</a>)</li><li>match(SYMBOL:<a href="ref_sys_symbols.html#PATTERN">PATTERN</a>)</li><li>[do(SYMBOL:<a href="ref_sys_symbols.html#ACTION">ACTION</a>)]</li><li>[with(SYMBOL:<a href="ref_sys_symbols.html#PARAMS">PARAMS</a>)]</li><li>[until(SYMBOL:<a href="ref_sys_symbols.html#END_CONDITIONS">END_CONDITIONS</a>)]</li></ol></td><td>error(SYMBOL:<a href="ref_sys_symbols.html#REDUCTION_ERROR_SYMBOL">REDUCTION_ERROR_SYMBOL</a>)</td><td><i>plant a listener</i><br /> If you don't provide an action, the assumption is that the LISTEN process will block and will reduce to the SEMTREX_MATCH. This will also force the END_CONDITIONS/REPETITIONS to ONCE</td></tr>
<tr><td><a name="LISTEN"></a>LISTEN</td><td><ol><li>on(SYMBOL:<a href="ref_sys_symbols.html#ASPECT">ASPECT</a>)</li><li>for(SYMBOL:<a href="ref_sys_symbols.html#CARRIER">CARRIER</a>)</li><li>match(SYMBOL:<a href="ref_sys_symbols.html#PATTERN">PATTERN</a>)</li><li>[do(SYMBOL:<a href="ref_sys_symbols.html#ACTION">ACTION</a>)]</li><li>[with(SYMBOL:<a href="ref_sys_symbols.html#PARAMS">PARAMS</a>)]</li><li>[until(SYMBOL:<a href="ref_sys_symbols.html#END_CONDITIONS">END_CONDITIONS</a>)]</li></ol></td><td>error(SYMBOL:<a href="ref_sys_symbols.html#REDUCTION_ERROR_SYMBOL">REDUCTION_ERROR_SYMBOL</a>)</td><td><i>plant a listener</i><br /> If you don't provide an action, the assumption is that the LISTEN process will block and will reduce to the SEMTREX_MATCH. This will also force the END_CONDITIONS/REPETITIONS to COUNT:1. If "for" carrier is NULL_SYMBOL the expectation will match on all carriers.</td></tr>
<tr><td><a name="RESPOND"></a>RESPOND</td><td><ol><li>response contents(ANY:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</li></ol></td><td>response id(SYMBOL:<a href="ref_sys_symbols.html#SIGNAL_UUID">SIGNAL_UUID</a>)</td><td><i>respond to signal</i></td></tr>
<tr><td><a name="QUOTE"></a>QUOTE</td><td><ol><li>process(PROCESS:<a href="ref_sys_symbols.html#NULL_PROCESS">NULL_PROCESS</a>)</li></ol></td><td>result(PASSTHRU:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</td><td><i>quote a process so that it can be passed as a value</i></td></tr>
<tr><td><a name="INTERPOLATE_FROM_MATCH"></a>INTERPOLATE_FROM_MATCH</td><td><ol></ol></td><td>result(STRUCTURE:<a href="ref_sys_symbols.html#TREE">TREE</a>)</td><td><i>interploate match result in place</i></td></tr>
Expand Down
5 changes: 3 additions & 2 deletions doxy/sys_structures.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<tr><td><a name="TUPLE_OF_PROCESS_IDENT_AND_CODE_PATH"></a>TUPLE-OF-PROCESS-IDENT-AND-CODE-PATH</td><td>SEQ(<a href="ref_sys_symbols.html#PROCESS_IDENT">PROCESS_IDENT</a>, <a href="ref_sys_symbols.html#CODE_PATH">CODE_PATH</a>)</td><td></td></tr>
<tr><td><a name="LIST_OF_SIGNAL_UUID_AND_CARRIER_AND_WAKEUP_REFERENCE_AND_END_CONDITIONS"></a>LIST-OF-SIGNAL-UUID-AND-CARRIER-AND-WAKEUP-REFERENCE-AND-END-CONDITIONS</td><td>SEQ(<a href="ref_sys_symbols.html#SIGNAL_UUID">SIGNAL_UUID</a>, <a href="ref_sys_symbols.html#CARRIER">CARRIER</a>, <a href="ref_sys_symbols.html#WAKEUP_REFERENCE">WAKEUP_REFERENCE</a>, <a href="ref_sys_symbols.html#END_CONDITIONS">END_CONDITIONS</a>)</td><td></td></tr>
<tr><td><a name="ZERO_OR_MORE_OF_PENDING_RESPONSE"></a>ZERO-OR-MORE-OF-PENDING-RESPONSE</td><td>*(<a href="ref_sys_symbols.html#PENDING_RESPONSE">PENDING_RESPONSE</a>)</td><td></td></tr>
<tr><td><a name="LIST_OF_CARRIER_AND_PATTERN_AND_ACTION_AND_PARAMS_AND_END_CONDITIONS"></a>LIST-OF-CARRIER-AND-PATTERN-AND-ACTION-AND-PARAMS-AND-END-CONDITIONS</td><td>SEQ(<a href="ref_sys_symbols.html#CARRIER">CARRIER</a>, <a href="ref_sys_symbols.html#PATTERN">PATTERN</a>, <a href="ref_sys_symbols.html#ACTION">ACTION</a>, <a href="ref_sys_symbols.html#PARAMS">PARAMS</a>, <a href="ref_sys_symbols.html#END_CONDITIONS">END_CONDITIONS</a>)</td><td></td></tr>
<tr><td><a name="ZERO_OR_MORE_OF_EXPECTATION"></a>ZERO-OR-MORE-OF-EXPECTATION</td><td>*(<a href="ref_sys_symbols.html#EXPECTATION">EXPECTATION</a>)</td><td></td></tr>
<tr><td><a name="LIST_OF_PROCESS_NAME_AND_PROCESS_INTENTION_AND_PROCESS_AND_PROCESS_SIGNATURE"></a>LIST-OF-PROCESS-NAME-AND-PROCESS-INTENTION-AND-PROCESS-AND-PROCESS-SIGNATURE</td><td>SEQ(<a href="ref_sys_symbols.html#PROCESS_NAME">PROCESS_NAME</a>, <a href="ref_sys_symbols.html#PROCESS_INTENTION">PROCESS_INTENTION</a>, <a href="ref_sys_symbols.html#PROCESS">PROCESS</a>, <a href="ref_sys_symbols.html#PROCESS_SIGNATURE">PROCESS_SIGNATURE</a>)</td><td></td></tr>
<tr><td><a name="ZERO_OR_MORE_OF_PROCESS_CODING"></a>ZERO-OR-MORE-OF-PROCESS-CODING</td><td>*(<a href="ref_sys_symbols.html#PROCESS_CODING">PROCESS_CODING</a>)</td><td></td></tr>
Expand All @@ -49,7 +50,7 @@
<tr><td><a name="TUPLE_OF_SIGNATURE_LABEL_AND_SIGNATURE_OUTPUT_TYPE"></a>TUPLE-OF-SIGNATURE-LABEL-AND-SIGNATURE-OUTPUT-TYPE</td><td>SEQ(<a href="ref_sys_symbols.html#SIGNATURE_LABEL">SIGNATURE_LABEL</a>, <a href="ref_sys_symbols.html#SIGNATURE_OUTPUT_TYPE">SIGNATURE_OUTPUT_TYPE</a>)</td><td></td></tr>
<tr><td><a name="TUPLE_OF_OUTPUT_SIGNATURE_AND_ZERO_OR_MORE_OF_INPUT_SIGNATURE"></a>TUPLE-OF-OUTPUT-SIGNATURE-AND-ZERO-OR-MORE-OF-INPUT-SIGNATURE</td><td>SEQ(<a href="ref_sys_symbols.html#OUTPUT_SIGNATURE">OUTPUT_SIGNATURE</a>, *(<a href="ref_sys_symbols.html#INPUT_SIGNATURE">INPUT_SIGNATURE</a>))</td><td></td></tr>
<tr><td><a name="SEQUENCE"></a>SEQUENCE</td><td>+(<a href="ref_sys_symbols.html#STEP_SYMBOL">STEP_SYMBOL</a>)</td><td></td></tr>
<tr><td><a name="PROTOCOL_STEP"></a>PROTOCOL_STEP</td><td>SEQ(<a href="ref_sys_symbols.html#PATTERN">PATTERN</a>, <a href="ref_sys_symbols.html#PARAMS">PARAMS</a>, <a href="ref_sys_symbols.html#ACTION">ACTION</a>)</td><td></td></tr>
<tr><td><a name="PROTOCOL_STEP"></a>PROTOCOL-STEP</td><td>SEQ(<a href="ref_sys_symbols.html#CARRIER">CARRIER</a>, <a href="ref_sys_symbols.html#PATTERN">PATTERN</a>, <a href="ref_sys_symbols.html#ACTION">ACTION</a>, ?(<a href="ref_sys_symbols.html#PARAMS">PARAMS</a>), ?(<a href="ref_sys_symbols.html#END_CONDITIONS">END_CONDITIONS</a>))</td><td></td></tr>
<tr><td><a name="ONE_OR_MORE_OF_INTERACTION"></a>ONE-OR-MORE-OF-INTERACTION</td><td>+(<a href="ref_sys_symbols.html#INTERACTION">INTERACTION</a>)</td><td></td></tr>
<tr><td><a name="PROTOCOL"></a>PROTOCOL</td><td>SEQ(<a href="ref_sys_symbols.html#STEPS">STEPS</a>, <a href="ref_sys_symbols.html#SEQUENCES">SEQUENCES</a>)</td><td></td></tr>
<tr><td><a name="LIST_OF_ZERO_OR_ONE_OF_RECEPTOR_ELAPSED_TIME"></a>LIST-OF-ZERO-OR-ONE-OF-RECEPTOR-ELAPSED-TIME</td><td>SEQ(?(<a href="ref_sys_symbols.html#RECEPTOR_ELAPSED_TIME">RECEPTOR_ELAPSED_TIME</a>))</td><td></td></tr>
Expand All @@ -60,7 +61,7 @@
<tr><td><a name="TIME"></a>TIME</td><td>SEQ(<a href="ref_sys_symbols.html#HOUR">HOUR</a>, <a href="ref_sys_symbols.html#MINUTE">MINUTE</a>, <a href="ref_sys_symbols.html#SECOND">SECOND</a>)</td><td></td></tr>
<tr><td><a name="TIMESTAMP"></a>TIMESTAMP</td><td>SEQ(<a href="ref_sys_symbols.html#TODAY">TODAY</a>, <a href="ref_sys_symbols.html#NOW">NOW</a>)</td><td></td></tr>
<tr><td><a name="REDUCTION_ERROR"></a>REDUCTION_ERROR</td><td><a href="ref_sys_symbols.html#ERROR_LOCATION">ERROR_LOCATION</a></td><td></td></tr>
<tr><td><a name="LOGICAL_OR_OF_COUNT_AND_UNLIMMITED"></a>LOGICAL-OR-OF-COUNT-AND-UNLIMMITED</td><td>OR(<a href="ref_sys_symbols.html#COUNT">COUNT</a>, <a href="ref_sys_symbols.html#UNLIMMITED">UNLIMMITED</a>)</td><td></td></tr>
<tr><td><a name="LOGICAL_OR_OF_COUNT_AND_UNLIMITED"></a>LOGICAL-OR-OF-COUNT-AND-UNLIMITED</td><td>OR(<a href="ref_sys_symbols.html#COUNT">COUNT</a>, <a href="ref_sys_symbols.html#UNLIMITED">UNLIMITED</a>)</td><td></td></tr>
<tr><td><a name="TUPLE_OF_ZERO_OR_ONE_OF_TIMEOUT_AT_AND_ZERO_OR_ONE_OF_REPETITIONS"></a>TUPLE-OF-ZERO-OR-ONE-OF-TIMEOUT-AT-AND-ZERO-OR-ONE-OF-REPETITIONS</td><td>SEQ(?(<a href="ref_sys_symbols.html#TIMEOUT_AT">TIMEOUT_AT</a>), ?(<a href="ref_sys_symbols.html#REPETITIONS">REPETITIONS</a>))</td><td></td></tr>
<tr><td><a name="TREE_DELTA"></a>TREE_DELTA</td><td>SEQ(<a href="ref_sys_symbols.html#TREE_DELTA_PATH">TREE_DELTA_PATH</a>, <a href="ref_sys_symbols.html#TREE_DELTA_VALUE">TREE_DELTA_VALUE</a>, <a href="ref_sys_symbols.html#TREE_DELTA_COUNT">TREE_DELTA_COUNT</a>)</td><td></td></tr>
<tr><td><a name="COMMAND"></a>COMMAND</td><td>SEQ(<a href="ref_sys_symbols.html#VERB">VERB</a>, *(<a href="ref_sys_symbols.html#COMMAND_PARAMETER">COMMAND_PARAMETER</a>))</td><td></td></tr>
Expand Down
12 changes: 6 additions & 6 deletions doxy/sys_symbols.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@
<tr><td><a name="WAKEUP_REFERENCE"></a>WAKEUP_REFERENCE</td><td><a href="ref_sys_structures.html#TUPLE_OF_PROCESS_IDENT_AND_CODE_PATH">TUPLE-OF-PROCESS-IDENT-AND-CODE-PATH</a></td><td></td></tr>
<tr><td><a name="PENDING_RESPONSE"></a>PENDING_RESPONSE</td><td><a href="ref_sys_structures.html#LIST_OF_SIGNAL_UUID_AND_CARRIER_AND_WAKEUP_REFERENCE_AND_END_CONDITIONS">LIST-OF-SIGNAL-UUID-AND-CARRIER-AND-WAKEUP-REFERENCE-AND-END-CONDITIONS</a></td><td></td></tr>
<tr><td><a name="PENDING_RESPONSES"></a>PENDING_RESPONSES</td><td><a href="ref_sys_structures.html#ZERO_OR_MORE_OF_PENDING_RESPONSE">ZERO-OR-MORE-OF-PENDING-RESPONSE</a></td><td></td></tr>
<tr><td><a name="RESPONSE_CARRIER"></a>RESPONSE_CARRIER</td><td><a href="ref_sys_structures.html#SYMBOL">SYMBOL</a></td><td> expected carrier for the response to a signal</td></tr>
<tr><td><a name="EXPECTATION"></a>EXPECTATION</td><td><a href="ref_sys_structures.html#SYMBOL">SYMBOL</a></td><td> surface of the listener is the carrier symbol, and it has two children_ID, expectation semtrex and action code tree</td></tr>
<tr><td><a name="EXPECTATIONS"></a>EXPECTATIONS</td><td><a href="ref_sys_structures.html#ZERO_OR_MORE_OF_EXPECTATION">ZERO-OR-MORE-OF-EXPECTATION</a></td><td> list of carrier/expectation/action tress that "listen" to changes on the flux</td></tr>
<tr><td><a name="RESPONSE_CARRIER"></a>RESPONSE_CARRIER</td><td><a href="ref_sys_structures.html#SYMBOL">SYMBOL</a></td><td> expected carrier for the response to a signal that "listen" to changes on the flux</td></tr>
<tr><td><a name="PATTERN"></a>PATTERN</td><td><a href="ref_sys_structures.html#SEMTREX">SEMTREX</a></td><td> expectation is a semtrex (thus has one child which is the first part of the semtrex)</td></tr>
<tr><td><a name="ACTION"></a>ACTION</td><td><a href="ref_sys_structures.html#PROCESS">PROCESS</a></td><td> code tree_ID, which specifies the action to perform when an expectation's semtrex matches</td></tr>
<tr><td><a name="PARAMS"></a>PARAMS</td><td><a href="ref_sys_structures.html#NULL_STRUCTURE">NULL-STRUCTURE</a></td><td></td></tr>
<tr><td><a name="EXPECTATION"></a>EXPECTATION</td><td><a href="ref_sys_structures.html#LIST_OF_CARRIER_AND_PATTERN_AND_ACTION_AND_PARAMS_AND_END_CONDITIONS">LIST-OF-CARRIER-AND-PATTERN-AND-ACTION-AND-PARAMS-AND-END-CONDITIONS</a></td><td></td></tr>
<tr><td><a name="EXPECTATIONS"></a>EXPECTATIONS</td><td><a href="ref_sys_structures.html#ZERO_OR_MORE_OF_EXPECTATION">ZERO-OR-MORE-OF-EXPECTATION</a></td><td> list of carrier/expectation/action tress</td></tr>
<tr><td><a name="INTERPOLATE_SYMBOL"></a>INTERPOLATE_SYMBOL</td><td><a href="ref_sys_structures.html#SYMBOL">SYMBOL</a></td><td> a place holder to indicate which symbol to insert into this part of the tree</td></tr>
<tr><td><a name="PROCESS_NAME"></a>PROCESS_NAME</td><td><a href="ref_sys_structures.html#CSTRING">CSTRING</a></td><td></td></tr>
<tr><td><a name="PROCESS_INTENTION"></a>PROCESS_INTENTION</td><td><a href="ref_sys_structures.html#CSTRING">CSTRING</a></td><td></td></tr>
Expand All @@ -88,7 +89,6 @@
<tr><td><a name="OUTPUT_SIGNATURE"></a>OUTPUT_SIGNATURE</td><td><a href="ref_sys_structures.html#TUPLE_OF_SIGNATURE_LABEL_AND_SIGNATURE_OUTPUT_TYPE">TUPLE-OF-SIGNATURE-LABEL-AND-SIGNATURE-OUTPUT-TYPE</a></td><td></td></tr>
<tr><td><a name="RUN_TREE"></a>RUN_TREE</td><td><a href="ref_sys_structures.html#TREE">TREE</a></td><td> think about this as a stack frame and its code</td></tr>
<tr><td><a name="PARAM_REF"></a>PARAM_REF</td><td><a href="ref_sys_structures.html#TREE_PATH">TREE-PATH</a></td><td> used in a code tree as a reference to a parameter</td></tr>
<tr><td><a name="PARAMS"></a>PARAMS</td><td><a href="ref_sys_structures.html#LIST">LIST</a></td><td></td></tr>
<tr><td><a name="RESULT_SYMBOL"></a>RESULT_SYMBOL</td><td><a href="ref_sys_structures.html#SYMBOL">SYMBOL</a></td><td></td></tr>
<tr><td><a name="REDUCTION_ERROR_SYMBOL"></a>REDUCTION_ERROR_SYMBOL</td><td><a href="ref_sys_structures.html#SYMBOL">SYMBOL</a></td><td></td></tr>
<tr><td><a name="PROTOCOLS"></a>PROTOCOLS</td><td><a href="ref_sys_structures.html#LIST">LIST</a></td><td></td></tr>
Expand Down Expand Up @@ -139,8 +139,8 @@
<tr><td><a name="GET_XADDR"></a>GET_XADDR</td><td><a href="ref_sys_structures.html#XADDR">XADDR</a></td><td></td></tr>
<tr><td><a name="TIMEOUT_AT"></a>TIMEOUT_AT</td><td><a href="ref_sys_structures.html#TIMESTAMP">TIMESTAMP</a></td><td> specifies a timeout for requests</td></tr>
<tr><td><a name="COUNT"></a>COUNT</td><td><a href="ref_sys_structures.html#INTEGER">INTEGER</a></td><td></td></tr>
<tr><td><a name="UNLIMMITED"></a>UNLIMMITED</td><td><a href="ref_sys_structures.html#NULL_STRUCTURE">NULL-STRUCTURE</a></td><td></td></tr>
<tr><td><a name="REPETITIONS"></a>REPETITIONS</td><td><a href="ref_sys_structures.html#LOGICAL_OR_OF_COUNT_AND_UNLIMMITED">LOGICAL-OR-OF-COUNT-AND-UNLIMMITED</a></td><td></td></tr>
<tr><td><a name="UNLIMITED"></a>UNLIMITED</td><td><a href="ref_sys_structures.html#NULL_STRUCTURE">NULL-STRUCTURE</a></td><td></td></tr>
<tr><td><a name="REPETITIONS"></a>REPETITIONS</td><td><a href="ref_sys_structures.html#LOGICAL_OR_OF_COUNT_AND_UNLIMITED">LOGICAL-OR-OF-COUNT-AND-UNLIMITED</a></td><td></td></tr>
<tr><td><a name="STX_TOKENS"></a>STX_TOKENS</td><td><a href="ref_sys_structures.html#LIST">LIST</a></td><td></td></tr>
<tr><td><a name="STX_SL"></a>STX_SL</td><td><a href="ref_sys_structures.html#NULL_STRUCTURE">NULL-STRUCTURE</a></td><td></td></tr>
<tr><td><a name="STX_OP"></a>STX_OP</td><td><a href="ref_sys_structures.html#NULL_STRUCTURE">NULL-STRUCTURE</a></td><td></td></tr>
Expand Down
10 changes: 5 additions & 5 deletions spec/accumulator_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <sys/stat.h>
#include <unistd.h>

void _testReceptorClockAddListener(Receptor *r);
void _testReceptorClockAddExpectation(Receptor *r);
void testAccBootStrap() {
spec_is_ptr_equal(G_vm,NULL);

Expand All @@ -35,12 +35,12 @@ void testAccBootStrap() {
spec_is_symbol_equal(G_vm->r,_t_symbol(clock->root),CLOCK_RECEPTOR);


// now add a listener in the clock
// now add an expectation in the clock
T *tick = __r_make_tick();
// _testReceptorClockAddListener(clock);
// _testReceptorClockAddExpectation(clock);

// sleep for a bit, which should allow the clock to run for a second
// and reduce the tick listener to the tick it received
// and reduce the tick expectation to the tick it received
//sleep(1);

// @todo, this is broken since weve changed how the clock receptor works...
Expand All @@ -59,7 +59,7 @@ void testAccBootStrap() {
// boot again
_a_boot(dname);

// verify that clock with planted listener and it's accumulated data are re-instantiated at boot
// verify that clock with planted expectation and it's accumulated data are re-instantiated at boot
Xaddr x = {INSTALLED_RECEPTOR,2};
T *ct = _r_get_instance(G_vm->r,x);
spec_is_true(ct != NULL);
Expand Down
12 changes: 6 additions & 6 deletions spec/process_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void testProcessRespond() {
ReceptorAddress f = 3; // DUMMY ADDR
ReceptorAddress t = 4; // DUMMY ADDR

T *s = __r_make_signal(f,t,DEFAULT_ASPECT,signal_contents,0,defaultCondition());
T *s = __r_make_signal(f,t,DEFAULT_ASPECT,signal_contents,0,defaultRequestUntil());

T *run_tree = _t_new_root(RUN_TREE);
T *n = _t_newr(run_tree,RESPOND);
Expand Down Expand Up @@ -886,10 +886,10 @@ void testProcessListen() {
spec_is_str_equal(t2s(n),"(REDUCTION_ERROR_SYMBOL:NULL_SYMBOL)"); //@todo is this right??
_t_free(n);

T *l = __r_get_listeners(r,DEFAULT_ASPECT);
spec_is_str_equal(t2s(l),"(EXPECTATIONS (EXPECTATION:TICK (PATTERN (SEMTREX_SYMBOL_LITERAL (SEMTREX_SYMBOL:TICK))) (PARAMS (INTERPOLATE_SYMBOL:NULL_SYMBOL)) (ACTION:NOOP (TEST_INT_SYMBOL:314))))");
T *ex = __r_get_expectations(r,DEFAULT_ASPECT);
spec_is_str_equal(t2s(ex),"(EXPECTATIONS (EXPECTATION (CARRIER:TICK) (PATTERN (SEMTREX_SYMBOL_LITERAL (SEMTREX_SYMBOL:TICK))) (ACTION:NOOP (TEST_INT_SYMBOL:314)) (PARAMS (INTERPOLATE_SYMBOL:NULL_SYMBOL)) (END_CONDITIONS (UNLIMITED))))");

_r_remove_listener(r, _t_child(l,1));
_r_remove_expectation(r, _t_child(ex,1));

// test listen that blocks
n = _t_new_root(LISTEN);
Expand All @@ -904,13 +904,13 @@ void testProcessListen() {
Q *q = r->q;
Qe *e = _p_addrt2q(q,run_tree);

//debug_enable(D_LISTEN);
// debug_enable(D_LISTEN+D_SIGNALS);
spec_is_equal(_p_reduceq(q),noReductionErr);
spec_is_equal(q->contexts_count,0);
spec_is_ptr_equal(q->blocked,e);
spec_is_str_equal(t2s(run_tree),"(RUN_TREE (process:LISTEN) (PARAMS))");

spec_is_str_equal(t2s(__r_get_listeners(r,DEFAULT_ASPECT)),"(EXPECTATIONS (EXPECTATION:TEST_STR_SYMBOL (PATTERN (SEMTREX_SYMBOL_LITERAL (SEMTREX_SYMBOL:TEST_STR_SYMBOL))) (PARAMS (INTERPOLATE_SYMBOL:NULL_SYMBOL)) (WAKEUP_REFERENCE (PROCESS_IDENT:1) (CODE_PATH:/1))))");
spec_is_str_equal(t2s(__r_get_expectations(r,DEFAULT_ASPECT)),"(EXPECTATIONS (EXPECTATION (CARRIER:TEST_STR_SYMBOL) (PATTERN (SEMTREX_SYMBOL_LITERAL (SEMTREX_SYMBOL:TEST_STR_SYMBOL))) (WAKEUP_REFERENCE (PROCESS_IDENT:1) (CODE_PATH:/1)) (PARAMS (INTERPOLATE_SYMBOL:NULL_SYMBOL)) (END_CONDITIONS (COUNT:1))))");

T *s = __r_make_signal(0,0,DEFAULT_ASPECT,_t_new_str(0,TEST_STR_SYMBOL,"fishy!"),0,0);
_r_deliver(r,s);
Expand Down
Loading

0 comments on commit bae6d60

Please sign in to comment.