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.

174 lines
4.2 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: test/component/test.component.inserters.variant_bool/test.component.inserters.variant_bool.cpp
  3. *
  4. * Purpose: Implementation file for the test.component.inserters.variant_bool project.
  5. *
  6. * Created: 18th June 2012
  7. * Updated: 18th June 2012
  8. *
  9. * Status: Wizard-generated
  10. *
  11. * License: (Licensed under the Synesis Software Open License)
  12. *
  13. * Copyright (c) 2012, Synesis Software Pty Ltd.
  14. * All rights reserved.
  15. *
  16. * www: http://www.synesis.com.au/software
  17. *
  18. * ////////////////////////////////////////////////////////////////////// */
  19. #include <pantheios/util/test/compiler_warnings_suppression.first_include.h>
  20. /* xTests Header Files */
  21. #include <xtests/xtests.h>
  22. /* Pantheios Header Files */
  23. #include <pantheios/pantheios.hpp> // Pantheios C++ main header
  24. #include <pantheios/inserters/variant_bool.hpp> // for pantheios::variant_bool
  25. #include <pantheios/backends/bec.test.h>
  26. /* STLSoft Header Files */
  27. #include <stlsoft/util/limit_traits.h>
  28. /* Standard C++ Header Files */
  29. #include <exception>
  30. #include <string>
  31. /* Standard C Header Files */
  32. #include <stdio.h>
  33. #include <stdlib.h>
  34. #include <pantheios/util/test/compiler_warnings_suppression.last_include.h>
  35. /* /////////////////////////////////////////////////////////////////////////
  36. * Forward declarations
  37. */
  38. static void test_1_01();
  39. static void test_1_02();
  40. static void test_1_03();
  41. static void test_1_04();
  42. static void test_1_05();
  43. static void test_1_06();
  44. static void test_1_07();
  45. static void test_1_08();
  46. static void test_1_09();
  47. static void test_1_10();
  48. /* /////////////////////////////////////////////////////////////////////////
  49. * Globals
  50. */
  51. PANTHEIOS_EXTERN_C const PAN_CHAR_T PANTHEIOS_FE_PROCESS_IDENTITY[] = PANTHEIOS_LITERAL_STRING("test.component.inserters.variant_bool");
  52. /* ////////////////////////////////////////////////////////////////////// */
  53. #define PSTR(x) PANTHEIOS_LITERAL_STRING(x)
  54. /* /////////////////////////////////////////////////////////////////////////
  55. * Character encoding
  56. */
  57. #ifdef PANTHEIOS_USE_WIDE_STRINGS
  58. # define XTESTS_TEST_STRING_EQUAL XTESTS_TEST_WIDE_STRING_EQUAL
  59. #else /* ? PANTHEIOS_USE_WIDE_STRINGS */
  60. # define XTESTS_TEST_STRING_EQUAL XTESTS_TEST_MULTIBYTE_STRING_EQUAL
  61. #endif /* PANTHEIOS_USE_WIDE_STRINGS */
  62. /* ////////////////////////////////////////////////////////////////////// */
  63. int main(int argc, char** argv)
  64. {
  65. int retCode = EXIT_SUCCESS;
  66. int verbosity = 2;
  67. XTESTS_COMMANDLINE_PARSEVERBOSITY(argc, argv, &verbosity);
  68. if(XTESTS_START_RUNNER("test.component.inserters.integer", verbosity))
  69. {
  70. XTESTS_RUN_CASE(test_1_01);
  71. XTESTS_RUN_CASE(test_1_02);
  72. XTESTS_RUN_CASE(test_1_03);
  73. XTESTS_RUN_CASE(test_1_04);
  74. XTESTS_RUN_CASE(test_1_05);
  75. XTESTS_RUN_CASE(test_1_06);
  76. XTESTS_RUN_CASE(test_1_07);
  77. XTESTS_RUN_CASE(test_1_08);
  78. XTESTS_RUN_CASE(test_1_09);
  79. XTESTS_RUN_CASE(test_1_10);
  80. XTESTS_PRINT_RESULTS();
  81. XTESTS_END_RUNNER_UPDATE_EXITCODE(&retCode);
  82. }
  83. return retCode;
  84. }
  85. /* ////////////////////////////////////////////////////////////////////// */
  86. static void test_1_01()
  87. {
  88. // 1. Setup
  89. pantheios::be::test::reset();
  90. // 2. Create test data
  91. pantheios::log_NOTICE(PSTR("{"), pantheios::variant_bool(false), PSTR("}"));
  92. pantheios::log_NOTICE(PSTR("{"), pantheios::variant_bool(true), PSTR("}"));
  93. // 3. Verification
  94. pantheios::be::test::Results results = pantheios::be::test::results();
  95. XTESTS_TEST(!results.empty());
  96. XTESTS_TEST_INTEGER_EQUAL(2u, results.size());
  97. XTESTS_TEST_STRING_EQUAL(PSTR("{VARIANT_FALSE}"), results[0].statement);
  98. XTESTS_TEST_STRING_EQUAL(PSTR("{VARIANT_TRUE}"), results[1].statement);
  99. }
  100. static void test_1_02()
  101. {
  102. }
  103. static void test_1_03()
  104. {
  105. }
  106. static void test_1_04()
  107. {
  108. }
  109. static void test_1_05()
  110. {
  111. }
  112. static void test_1_06()
  113. {
  114. }
  115. static void test_1_07()
  116. {
  117. }
  118. static void test_1_08()
  119. {
  120. }
  121. static void test_1_09()
  122. {
  123. }
  124. static void test_1_10()
  125. {
  126. }
  127. /* ///////////////////////////// end of file //////////////////////////// */