projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Implement function to determine how many cores are available.
[m6w6/libmemcached]
/
libtest
/
test.cc
diff --git
a/libtest/test.cc
b/libtest/test.cc
index 92c1226b24ffca5e7b686926b99753c20051200c..66d258a0b009094430793e268598203ee8a836b9 100644
(file)
--- a/
libtest/test.cc
+++ b/
libtest/test.cc
@@
-226,9
+226,7
@@
int main(int argc, char *argv[])
delete world;
return EXIT_SUCCESS;
delete world;
return EXIT_SUCCESS;
- case TEST_FATAL:
case TEST_FAILURE:
case TEST_FAILURE:
- case TEST_MEMORY_ALLOCATION_FAILURE:
delete world;
return EXIT_FAILURE;
}
delete world;
return EXIT_FAILURE;
}
@@
-276,7
+274,6
@@
int main(int argc, char *argv[])
case TEST_SUCCESS:
break;
case TEST_SUCCESS:
break;
- case TEST_FATAL:
case TEST_FAILURE:
Out << next->name << " [ failed ]";
failed= true;
case TEST_FAILURE:
Out << next->name << " [ failed ]";
failed= true;
@@
-288,8
+285,8
@@
int main(int argc, char *argv[])
skipped= true;
goto cleanup;
skipped= true;
goto cleanup;
-
case TEST_MEMORY_ALLOCATION_FAILURE
:
- t
est_assert(0, "Allocation failure, or unknown return
");
+
default
:
+ t
hrow fatal_message("invalid return code
");
}
Out << "Collection: " << next->name;
}
Out << "Collection: " << next->name;
@@
-381,7
+378,6
@@
int main(int argc, char *argv[])
stats.success++;
break;
stats.success++;
break;
- case TEST_FATAL:
case TEST_FAILURE:
stats.failed++;
failed= true;
case TEST_FAILURE:
stats.failed++;
failed= true;
@@
-394,8
+390,8
@@
int main(int argc, char *argv[])
Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
break;
Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
break;
-
case TEST_MEMORY_ALLOCATION_FAILURE
:
- t
est_assert(0, "Memory Allocation Error
");
+
default
:
+ t
hrow fatal_message("invalid return code
");
}
if (test_failed(world->on_error(return_code, creators_ptr)))
}
if (test_failed(world->on_error(return_code, creators_ptr)))
@@
-464,6
+460,10
@@
cleanup:
{
std::cerr << e.what() << std::endl;
}
{
std::cerr << e.what() << std::endl;
}
+ catch (std::bad_alloc& e)
+ {
+ std::cerr << e.what() << std::endl;
+ }
catch (...)
{
std::cerr << "Unknown exception halted execution" << std::endl;
catch (...)
{
std::cerr << "Unknown exception halted execution" << std::endl;