First public contribution.
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Name : unexpected_handler_test.cpp
15 // Part of : standard c++ tests.
20 #include "test_decls.h"
27 * The handler is invoked so terminate
29 CPP_TESTS_ASSERT_ALLWAYS(1);
40 std::unexpected_handler hu_old,hu_new;
41 // std::terminate_handler ht_old,ht_new;
43 hu_new = (std::unexpected_handler)&foo;
44 hu_old = std::set_unexpected(hu_new);
45 hu_old = hu_old;//get rid of the warning
47 // ht_new = (std::terminate_handler)&foo;
48 // ht_old = std::set_terminate(ht_new);
53 * Failure case. If we reach here, the unexpected_handler wasn't
56 CPP_TESTS_ASSERT_ALLWAYS(0);