Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. #define BOOST_TEST_MODULE testmodule
  2. #include <boost/test/included/unit_test.hpp>
  3.  
  4. #include <AL/al.h>
  5. #include <AL/alc.h>
  6.  
  7. /*
  8. * This program will run fine until the exit. (the test suite will succeed)
  9. * But at the exit, a currupted double-linked list is detected + backtrace is printed
  10. */
  11.  
  12. /*
  13. * Compile with:
  14. * g++ main.cpp -o main -g3 -gdwarf-2 -lboost_unit_test_framework -lopenal
  15. *
  16. * Run the not crashintg test with:
  17. * ./main -t no_crash
  18. *
  19. * Run the crashing test(s) with:
  20. * ./main -t crash
  21. * ./main -t crash2
  22. *
  23. */
  24.  
  25. BOOST_AUTO_TEST_CASE(no_crash) {
  26. ALCdevice *alDevice;
  27.  
  28. alDevice = alcOpenDevice(NULL);
  29. alcCloseDevice(alDevice);
  30. }
  31.  
  32. BOOST_AUTO_TEST_CASE(crash) {
  33. ALCdevice *alDevice;
  34. ALCcontext *alContext;
  35.  
  36. alDevice = alcOpenDevice(NULL);
  37. alContext = alcCreateContext(alDevice, nullptr);
  38. }
  39.  
  40. BOOST_AUTO_TEST_CASE(crash2) {
  41. ALCdevice *alDevice;
  42. ALCcontext *alContext;
  43.  
  44. alDevice = alcOpenDevice(NULL);
  45. alContext = alcCreateContext(alDevice, nullptr);
  46. alcDestroyContext(alContext);
  47. alcCloseDevice(alDevice);
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement