Changeset 1950837


Ignore:
Timestamp:
Mar 14, 2023, 3:52:34 PM (14 months ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
5217569
Parents:
8512a2f
Message:

added virtual dtor test to actor test suite, updated other relevant tests accordingly

Location:
tests/concurrent/actors
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/actors/executor.cfa

    r8512a2f r1950837  
    1515};
    1616void ?{}( d_actor & this ) with(this) {
    17     ((actor &)this){};
    1817    id = ids++;
    1918    gstart = (&this + (id / Set * Set - id)); // remember group-start array-element
  • tests/concurrent/actors/poison.cfa

    r8512a2f r1950837  
    55#include <stdio.h>
    66
    7 struct Server { inline actor; };
     7struct Server { int val; inline actor; };
     8
     9void ?{}( Server & this ) { this.val = 999; }
     10void ^?{}( Server & this ) { this.val = 777; }
    811
    912int main() {
     
    1215    sout | "Finished";
    1316    {
    14     start_actor_system();
    15     Server s[10];
    16     for ( i; 10 ) {
    17         s[i] << FinishedMsg;
    18     }
    19     stop_actor_system();
     17        start_actor_system();
     18        Server s[10];
     19        for ( i; 10 ) {
     20            s[i] << FinishedMsg;
     21        }
     22        stop_actor_system();
    2023    }
    2124
    2225    sout | "Delete";
    2326    {
    24     start_actor_system();
    25     for ( i; 10 ) {
    26         Server * s = alloc();
    27         (*s){};
    28         (*s) << DeleteMsg;
    29     }
    30     stop_actor_system();
     27        start_actor_system();
     28        for ( i; 10 ) {
     29            Server * s = alloc();
     30            (*s){};
     31            (*s) << DeleteMsg;
     32        }
     33        stop_actor_system();
    3134    }
    3235
    3336    sout | "Destroy";
    3437    {
    35     start_actor_system();
    36     Server s[10];
    37     for ( i; 10 ) {
    38         s[i] << DestroyMsg;
    39     }
    40     stop_actor_system();
     38        start_actor_system();
     39        Server s[10];
     40        for ( i; 10 )
     41            s[i] << DestroyMsg;
     42        stop_actor_system();
     43        for ( i; 10 )
     44            if (s[i].val != 777)
     45                sout | "Error: dtor not called correctly.";
    4146    }
    4247
Note: See TracChangeset for help on using the changeset viewer.