Ejemplo n.º 1
0
int main(int argc, char* argv[])
{
    int status = 0;
    bool testAll = false;
    if  (testAll) {
        status += test_rotatedString();
        status += test_threeWayPartition();
        status += test_slicingProblem();
        status += test_charString();
        status += test_fibmemo();
        status += test_for_each();
        status += BoggleBoard::unit_test();
        status += Sum123::unit_test();
        status += RandModN::unit_test();
        status += BinLink::unit_test();
        status += test_NlightBulbs(100);
        status += test_Kadane();
        status += test_interleaveInPlace();

    }
    status += test_uniqueCharSubString();
    status += test_macro();
    status += test_bitvector();
    //getchar(); // modify commnad window properties while waiting for input
    return status;
}
Ejemplo n.º 2
0
int main(void) {
    type_t tau;

    init_type_table(&types, 0);
    init_variables();
    init_types();

    // pair(A) = (tuple A A)
    tau = pair_type(var[0], var[0]);
    test_macro("pair", 1, var, tau);

    // triple(B) = (tuple B B B)
    tau = triple_type(var[1], var[1], var[1]);
    test_macro("triple", 1, var+1, tau);

    // test(C, D) = bool
    test_macro("test", 2, var+2, base[0]);

    // fun(E, F) = (-> (tuple E E) F)
    tau = pair_type(var[4], var[4]);
    tau = function_type(&types, var[5], 1, &tau);
    test_macro("fun", 2, var+4, tau);

    // two constructors
    test_constructor("mk_type2", 2);
    test_constructor("mk_type3", 3);

    printf("\n====== TYPES ========\n");
    print_type_table(stdout, &types);
    printf("\n===== MACROS ========\n");
    print_type_macros(stdout, &types);
    printf("===\n\n");

    // creation after remove
    // vector[G] = (-> int G)
    tau = int_type(&types);
    tau = function_type(&types, var[6], 1, &tau);
    test_macro("vector", 1, var+6, tau);

    // matrix[H] = (-> int int H)
    tau = int_type(&types);
    tau = binary_ftype(tau, tau, var[7]);
    test_macro("matrix", 1, var+7, tau);

    printf("\n====== TYPES ========\n");
    print_type_table(stdout, &types);
    printf("\n===== MACROS ========\n");
    print_type_macros(stdout, &types);
    printf("===\n\n");

    delete_type_table(&types);

    return 0;
}
Ejemplo n.º 3
0
int main(int argc, char *argv[]) {
  clog::log_verbose = 100;
  CLOG(INFO, "start");
  test_macro();
  test_every_n();
  test_every_sec();
  test_verbose();
  CLOG_CHECK_EQ(1, 1, "1 == 1");
  for (int i = 0; i < 10000; ++i) {
    CLOG_CHECK_EQ(i, i, i, "==", i);
  }
  CLOG_CHECK_LT(1, 2, "1 < 2");
  CLOG_CHECK_EQ(1, 2, "1 == 2, fatal");
  {
    int i = 0;
    CLOG_CHECK_EQ(i, 0);
  }
}
Ejemplo n.º 4
0
int main()
{
   test_symbol();
   test_integer();
   test_cell();
   test_list();
   test_environment();
   test_eval();
   test_plus_integer();
   test_begin();
   test_string();
   test_tokenize();
   test_newlispobj();
   test_expandreadmacro();
   test_read_tokens();
   test_macro();
   test_equal();
   test_cond();

   return 0;
}
Ejemplo n.º 5
0
int main(int argc, char const *argv[]){
    test_macro();
    printf("%s\n", os);
    return 0;
}