OLD | NEW |
1 /* Copyright (c) 2011-2013 Xiph.Org Foundation | 1 /* Copyright (c) 2011-2013 Xiph.Org Foundation |
2 Written by Gregory Maxwell */ | 2 Written by Gregory Maxwell */ |
3 /* | 3 /* |
4 Redistribution and use in source and binary forms, with or without | 4 Redistribution and use in source and binary forms, with or without |
5 modification, are permitted provided that the following conditions | 5 modification, are permitted provided that the following conditions |
6 are met: | 6 are met: |
7 | 7 |
8 - Redistributions of source code must retain the above copyright | 8 - Redistributions of source code must retain the above copyright |
9 notice, this list of conditions and the following disclaimer. | 9 notice, this list of conditions and the following disclaimer. |
10 | 10 |
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1746 * under GCC. However, this is the cleanest way to test malloc failure | 1746 * under GCC. However, this is the cleanest way to test malloc failure |
1747 * handling in our codebase, and the lack of thread safety isn't an | 1747 * handling in our codebase, and the lack of thread safety isn't an |
1748 * issue here. We therefore disable the warning for this function. | 1748 * issue here. We therefore disable the warning for this function. |
1749 */ | 1749 */ |
1750 #if OPUS_GNUC_PREREQ(4,6) | 1750 #if OPUS_GNUC_PREREQ(4,6) |
1751 /* Save the current warning settings */ | 1751 /* Save the current warning settings */ |
1752 #pragma GCC diagnostic push | 1752 #pragma GCC diagnostic push |
1753 #endif | 1753 #endif |
1754 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" | 1754 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
1755 | 1755 |
1756 typedef void *(*mhook)(size_t __size, __const __malloc_ptr_t); | 1756 typedef void *(*mhook)(size_t __size, __const void *); |
1757 #endif | 1757 #endif |
1758 | 1758 |
1759 int test_malloc_fail(void) | 1759 int test_malloc_fail(void) |
1760 { | 1760 { |
1761 #ifdef MALLOC_FAIL | 1761 #ifdef MALLOC_FAIL |
1762 OpusDecoder *dec; | 1762 OpusDecoder *dec; |
1763 OpusEncoder *enc; | 1763 OpusEncoder *enc; |
1764 OpusRepacketizer *rp; | 1764 OpusRepacketizer *rp; |
1765 unsigned char mapping[256] = {0,1}; | 1765 unsigned char mapping[256] = {0,1}; |
1766 OpusMSDecoder *msdec; | 1766 OpusMSDecoder *msdec; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1888 total+=test_msdec_api(); | 1888 total+=test_msdec_api(); |
1889 total+=test_parse(); | 1889 total+=test_parse(); |
1890 total+=test_enc_api(); | 1890 total+=test_enc_api(); |
1891 total+=test_repacketizer_api(); | 1891 total+=test_repacketizer_api(); |
1892 total+=test_malloc_fail(); | 1892 total+=test_malloc_fail(); |
1893 | 1893 |
1894 fprintf(stderr,"\nAll API tests passed.\nThe libopus API was invoked %d times
.\n",total); | 1894 fprintf(stderr,"\nAll API tests passed.\nThe libopus API was invoked %d times
.\n",total); |
1895 | 1895 |
1896 return 0; | 1896 return 0; |
1897 } | 1897 } |
OLD | NEW |