Changeset 428adbc for tests


Ignore:
Timestamp:
Aug 10, 2022, 8:33:42 PM (2 years ago)
Author:
z277zhu <z277zhu@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
7f6a7c9
Parents:
20be782
Message:

fix pthread_sig* interpose problems; add test doc

Signed-off-by: z277zhu <z277zhu@…>

Location:
tests/concurrent/pthread
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/pthread/.expect/pthread_attr_test.txt

    r20be782 r428adbc  
    1 Hi
     1stack size is 123456789
  • tests/concurrent/pthread/bounded_buffer.cfa

    r20be782 r428adbc  
    44#include <pthread.h>
    55#include <errno.h>
     6// tested pthread mutex related routines, pthread cond related routines
     7// tested pthread_create/join
     8
    69enum { BufferSize = 50 };
    710
  • tests/concurrent/pthread/pthread_attr_test.cfa

    r20be782 r428adbc  
    44#include <thread.hfa>
    55
    6 void* foo(void* arg){
    7     sout | "Hi";
     6void* foo(void* _attr){
     7    size_t size;
     8    pthread_attr_t* attr = (pthread_attr_t*)_attr;
     9    int status = pthread_attr_getstacksize(attr, &size);
     10    if (status != 0){
     11        sout | "error return code";
     12        exit(1);
     13    }
     14    sout | "stack size is " | size;
    815    return NULL;
    916}
     
    1623    pthread_t thr;
    1724    void* res;
    18     pthread_create(&thr, &attr, foo, NULL);
     25    pthread_create(&thr, &attr, foo, (void*)&attr);
    1926    pthread_join(thr, &res);
    20     //pthread_attr_destroy(&attr);
     27    pthread_attr_destroy(&attr);
    2128    return 0;
    2229}
  • tests/concurrent/pthread/pthread_cond_test.cfa

    r20be782 r428adbc  
    1 /* test cond provide sync */
     1/* small test of pthread cond */
    22
    33#include <fstream.hfa>
  • tests/concurrent/pthread/pthread_demo_create_join.cfa

    r20be782 r428adbc  
    11#include <fstream.hfa>
    22#include <thread.hfa>
    3 /* test that threads can create successfully and join correct result */
     3/* test pthread create/join/exit */
     4
    45int arr[20];
    56
  • tests/concurrent/pthread/pthread_key_test.cfa

    r20be782 r428adbc  
    11
    2 /* This test is to test that multiple threads can create one key and set their own specifics
     2/* test pthread_key_create/set_specific/get_specific
    33    get specific == set specific
    44    dtor is invoked (no mem leak)
  • tests/concurrent/pthread/pthread_once_test.cfa

    r20be782 r428adbc  
    1 #ifndef _OPEN_THREADS                                                           
    2 #define _OPEN_THREADS                                                           
    3 #endif                                                                         
     1// tested pthread once,create,join
     2
    43                                                         
    54                                                                               
Note: See TracChangeset for help on using the changeset viewer.