tests/main.cpp
changeset 12 cebfc7eeafa5
parent 11 cfe800908837
     1.1 --- a/tests/main.cpp	Mon Aug 26 23:18:03 2013 -0700
     1.2 +++ b/tests/main.cpp	Tue Aug 27 00:49:33 2013 -0700
     1.3 @@ -30,6 +30,7 @@
     1.4  #include <stddef.h>
     1.5  #include <stdio.h>
     1.6  #include <stdlib.h>
     1.7 +#include <string.h>
     1.8  #include "runner.h"
     1.9  
    1.10  using namespace ke;
    1.11 @@ -40,6 +41,10 @@
    1.12  {
    1.13    Test *test = Test::first();
    1.14    while (test) {
    1.15 +    if (argc >= 2 && strcmp(argv[1], test->name()) != 0) {
    1.16 +      test = test->next();
    1.17 +      continue;
    1.18 +    }
    1.19      fprintf(stdout, "Testing %s... \n", test->name());
    1.20      if (!test->Run()) {
    1.21        fprintf(stdout, "TEST:%s FAIL\n", test->name());
    1.22 @@ -61,8 +66,18 @@
    1.23    return malloc(amount);
    1.24  }
    1.25  
    1.26 +void *operator new[](size_t amount)
    1.27 +{
    1.28 +  return malloc(amount);
    1.29 +}
    1.30 +
    1.31  void operator delete(void *p)
    1.32  {
    1.33    free(p);
    1.34  }
    1.35 +
    1.36 +void operator delete[](void *p)
    1.37 +{
    1.38 +  free(p);
    1.39 +}
    1.40  #endif