Ejemplo n.º 1
0
 static void run()
 {
   std::cout << "coro_ut begin." << std::endl;
   for (std::size_t i=0; i<test_count; ++i)
   {
     test_common();
     if (test_count > 1) std::cout << "\r" << i;
   }
   if (test_count > 1) std::cout << std::endl;
   std::cout << "coro_ut end." << std::endl;
 }
Ejemplo n.º 2
0
 static void run()
 {
   std::cout << "coro_ut begin." << std::endl;
   test_common();
   std::cout << "coro_ut end." << std::endl;
 }
Ejemplo n.º 3
0
int main()
{
    sio << "short: " << sizeof(short) << "  long: " << sizeof(long)
        << "  long long: " << sizeof(long long) << "  int: " << sizeof(int)
        << "  void*: " << sizeof(void*) << "  float: " << sizeof(float)
        << "  double: " << sizeof(double) << '\n';
    sio << "integer: " << sizeof(integer) << "  memint: " << sizeof(memint)
        << "  real: " << sizeof(real) << "  variant: " << sizeof(variant)
        << "  object: " << sizeof(object) << "  rtobject: " << sizeof(rtobject) << '\n';
    sio << "stateobj: " << sizeof(stateobj) << "  Type: " << sizeof(Type)
        << "  State: " << sizeof(State) << "  opcodes: " << opMaxCode << '\n';

    check(sizeof(memint) == sizeof(void*));
    check(sizeof(memint) == sizeof(size_t));

#ifdef SHN_64
    check(sizeof(integer) == 8);
    check(sizeof(variant) <= 16);
#else
    check(sizeof(integer) == 4);
    check(sizeof(variant) <= 12);
#endif

    initRuntime();
    initTypeSys();
    initVm();

    int exitcode = 0;
    try
    {
        test_common();
        test_object();
        test_ordset();
        test_bytevec();
        test_string();
        test_strutils();
        test_podvec();
        test_vector();
        test_dict();
        test_set();
        test_symtbl();
        test_variant();
        test_fifos();
        test_parser();
//        test_typesys();
//        test_codegen();
    }
    catch (exception& e)
    {
        fprintf(stderr, "Exception: %s\n", e.what());
        exitcode = 201;
    }

    doneVm();
    doneTypeSys();
    doneRuntime();

    if (object::allocated != 0)
    {
        fprintf(stderr, "Error: object::allocated = %d\n", object::allocated);
        exitcode = 202;
    }

    return exitcode;
}