A thread scheduler test and a similar test for TBB.

This commit is contained in:
Vahagn Khachatryan
2013-06-20 17:59:54 +05:00
parent 2903f5d6c6
commit 543a2948a7
5 changed files with 218 additions and 0 deletions

31
test_placement_new.cpp Normal file
View File

@@ -0,0 +1,31 @@
#include <malloc.h>
#include <iostream>
#include <exception>
void * operator new ( size_t s, const std::string& str )
{
std::cout << str << std::endl;
return malloc( s );
}
int main ( void )
{try{
int * i = new (std::string("Hello")) int;
return 0;
}
catch ( const std::exception& e )
{
std::cerr << std::endl
<< "std::exception(\"" << e.what() << "\")." << std::endl;
return 2;
}
catch ( ... )
{
std::cerr << std::endl
<< "unknown exception." << std::endl;
return 1;
}}