You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
3.6 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: test/scratch/test.scratch.be.N.fail/test.scratch.be.N.fail.cpp
  3. *
  4. * Purpose: Implementation file for the be.N.fail.test project.
  5. *
  6. * Created: 9th January 2007
  7. * Updated: 23rd March 2010
  8. *
  9. * Status: Wizard-generated
  10. *
  11. * License: (Licensed under the Synesis Software Open License)
  12. *
  13. * Copyright (c) 2007-2010, Synesis Software Pty Ltd.
  14. * All rights reserved.
  15. *
  16. * www: http://www.synesis.com.au/software
  17. *
  18. * ////////////////////////////////////////////////////////////////////// */
  19. #define PANTHEIOS_NO_INCLUDE_OS_AND_3PTYLIB_STRING_ACCESS
  20. /* This inclusion required for suppressing warnings during NoX (No eXception-support) configurations. */
  21. #include <pantheios/util/test/compiler_warnings_suppression.first_include.h>
  22. /* Pantheios Header Files */
  23. #include <pantheios/pantheios.hpp>
  24. #include <pantheios/inserters/exception.hpp>
  25. #include <pantheios/frontends/fe.N.h>
  26. #include <pantheios/backends/be.N.h>
  27. #include <pantheios/backends/bec.fail.h>
  28. #include <pantheios/backends/bec.file.h>
  29. #include <pantheios/backends/bec.fprintf.h>
  30. /* Standard C++ Header Files */
  31. #ifdef STLSOFT_CF_EXCEPTION_SUPPORT
  32. # include <exception>
  33. #endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
  34. /* Standard C Header Files */
  35. #include <stdlib.h>
  36. #if defined(_MSC_VER) && \
  37. defined(_DEBUG)
  38. # include <crtdbg.h>
  39. #endif /* _MSC_VER) && _DEBUG */
  40. #include <pantheios/util/test/compiler_warnings_suppression.last_include.h>
  41. /* ////////////////////////////////////////////////////////////////////// */
  42. #define PSTR(x) PANTHEIOS_LITERAL_STRING(x)
  43. /* /////////////////////////////////////////////////////////////////////////
  44. * Globals
  45. */
  46. extern "C"
  47. {
  48. const PAN_CHAR_T PANTHEIOS_FE_PROCESS_IDENTITY[] = PANTHEIOS_LITERAL_STRING("be.N.fail.test");
  49. pan_fe_N_t PAN_FE_N_SEVERITY_CEILINGS[] =
  50. {
  51. { 0, PANTHEIOS_SEV_DEBUG }
  52. };
  53. pan_be_N_t PAN_BE_N_BACKEND_LIST[] =
  54. {
  55. PANTHEIOS_BE_N_STDFORM_ENTRY(1, pantheios_be_fail, PANTHEIOS_BE_N_F_IGNORE_INIT_FAILURE),
  56. PANTHEIOS_BE_N_STDFORM_ENTRY(2, pantheios_be_file, 0),
  57. PANTHEIOS_BE_N_STDFORM_ENTRY(3, pantheios_be_fail, PANTHEIOS_BE_N_F_IGNORE_INIT_FAILURE),
  58. PANTHEIOS_BE_N_STDFORM_ENTRY(4, pantheios_be_fprintf, 0),
  59. PANTHEIOS_BE_N_TERMINATOR_ENTRY
  60. };
  61. } // extern "C"
  62. /* ////////////////////////////////////////////////////////////////////// */
  63. static int main_(int /* argc */, char ** /*argv*/)
  64. {
  65. pantheios::log_NOTICE(PSTR("a notice"));
  66. return EXIT_SUCCESS;
  67. }
  68. int main(int argc, char *argv[])
  69. {
  70. int res;
  71. #if defined(_MSC_VER) && \
  72. defined(_DEBUG)
  73. _CrtMemState memState;
  74. #endif /* _MSC_VER && _MSC_VER */
  75. #if defined(_MSC_VER) && \
  76. defined(_DEBUG)
  77. _CrtMemCheckpoint(&memState);
  78. #endif /* _MSC_VER && _MSC_VER */
  79. #ifdef STLSOFT_CF_EXCEPTION_SUPPORT
  80. try
  81. {
  82. #endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
  83. res = main_(argc, argv);
  84. #ifdef STLSOFT_CF_EXCEPTION_SUPPORT
  85. }
  86. catch(std::exception &x)
  87. {
  88. pantheios::log_ALERT(PSTR("Unexpected general error: "), pantheios::exception(x), PSTR(". Application terminating"));
  89. res = EXIT_FAILURE;
  90. }
  91. catch(...)
  92. {
  93. pantheios::logputs(pantheios::emergency, PSTR("Unhandled unknown error"));
  94. res = EXIT_FAILURE;
  95. }
  96. #endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
  97. #if defined(_MSC_VER) && \
  98. defined(_DEBUG)
  99. _CrtMemDumpAllObjectsSince(&memState);
  100. #endif /* _MSC_VER) && _DEBUG */
  101. return res;
  102. }
  103. /* ////////////////////////////////////////////////////////////////////// */