filex_file_date_time_set_test.c 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. /* This FileX test concentrates on the file date/time set operation. */
  2. #ifndef FX_STANDALONE_ENABLE
  3. #include "tx_api.h"
  4. #endif
  5. #include "fx_api.h"
  6. #include <stdio.h>
  7. #include "fx_ram_driver_test.h"
  8. #define DEMO_STACK_SIZE 4096
  9. #define CACHE_SIZE 128*128
  10. /* Define the ThreadX and FileX object control blocks... */
  11. #ifndef FX_STANDALONE_ENABLE
  12. static TX_THREAD ftest_0;
  13. #endif
  14. static FX_MEDIA ram_disk;
  15. static FX_FILE file_0;
  16. static FX_FILE file_1;
  17. static FX_FILE file_2;
  18. static FX_FILE file_3;
  19. static FX_FILE file_4;
  20. static FX_FILE file_5;
  21. static FX_FILE file_6;
  22. /* Define the counters used in the test application... */
  23. #ifndef FX_STANDALONE_ENABLE
  24. static UCHAR *ram_disk_memory;
  25. static UCHAR *cache_buffer;
  26. #else
  27. static UCHAR cache_buffer[CACHE_SIZE];
  28. #endif
  29. /* Define thread prototypes. */
  30. void filex_file_date_time_set_application_define(void *first_unused_memory);
  31. static void ftest_0_entry(ULONG thread_input);
  32. VOID _fx_ram_driver(FX_MEDIA *media_ptr);
  33. void test_control_return(UINT status);
  34. /* Define what the initial system looks like. */
  35. #ifdef CTEST
  36. void test_application_define(void *first_unused_memory)
  37. #else
  38. void filex_file_date_time_set_application_define(void *first_unused_memory)
  39. #endif
  40. {
  41. #ifndef FX_STANDALONE_ENABLE
  42. UCHAR *pointer;
  43. /* Setup the working pointer. */
  44. pointer = (UCHAR *) first_unused_memory;
  45. /* Create the main thread. */
  46. tx_thread_create(&ftest_0, "thread 0", ftest_0_entry, 0,
  47. pointer, DEMO_STACK_SIZE,
  48. 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START);
  49. pointer = pointer + DEMO_STACK_SIZE;
  50. /* Setup memory for the RAM disk and the sector cache. */
  51. cache_buffer = pointer;
  52. pointer = pointer + CACHE_SIZE;
  53. ram_disk_memory = pointer;
  54. #endif
  55. /* Initialize the FileX system. */
  56. fx_system_initialize();
  57. #ifdef FX_STANDALONE_ENABLE
  58. ftest_0_entry(0);
  59. #endif
  60. }
  61. /* Define the test threads. */
  62. static void ftest_0_entry(ULONG thread_input)
  63. {
  64. UINT status;
  65. UINT attributes;
  66. ULONG size;
  67. UINT year, month, day, hour, minute, second;
  68. #ifndef FX_DISABLE_ERROR_CHECKING
  69. UINT i;
  70. #endif /* FX_DISABLE_ERROR_CHECKING */
  71. FX_FILE my_file;
  72. FX_PARAMETER_NOT_USED(thread_input);
  73. /* Print out some test information banners. */
  74. printf("FileX Test: File date/time set test................................");
  75. /* Format the media. This needs to be done before opening it! */
  76. status = fx_media_format(&ram_disk,
  77. _fx_ram_driver, // Driver entry
  78. ram_disk_memory, // RAM disk memory pointer
  79. cache_buffer, // Media buffer pointer
  80. CACHE_SIZE, // Media buffer size
  81. "MY_RAM_DISK", // Volume Name
  82. 1, // Number of FATs
  83. 32, // Directory Entries
  84. 0, // Hidden sectors
  85. 512, // Total sectors
  86. 128, // Sector size
  87. 1, // Sectors per cluster
  88. 1, // Heads
  89. 1); // Sectors per track
  90. /* Determine if the format had an error. */
  91. if (status)
  92. {
  93. printf("ERROR!\n");
  94. test_control_return(1);
  95. }
  96. /* try to retrieve directory information before the media has been opened to generate an error */
  97. status = fx_directory_information_get(&ram_disk, "DOES_NOT_EXIST", &attributes, &size,
  98. &year, &month, &day, &hour, &minute, &second);
  99. if (status != FX_MEDIA_NOT_OPEN)
  100. {
  101. printf("ERROR!\n");
  102. test_control_return(2);
  103. }
  104. /* Attempt to set the date and time for a file before the media is opened to generate an error */
  105. status = fx_file_date_time_set(&ram_disk, "TEST.TXT", 2000, 1, 1, 1, 1, 1);
  106. if (status != FX_MEDIA_NOT_OPEN)
  107. {
  108. printf("ERROR!\n");
  109. test_control_return(3);
  110. }
  111. /* Open the ram_disk. */
  112. status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, cache_buffer, CACHE_SIZE);
  113. /* Check the status. */
  114. if (status != FX_SUCCESS)
  115. {
  116. /* Error, return error code. */
  117. printf("ERROR!\n");
  118. test_control_return(4);
  119. }
  120. /* Create a few files file in the root directory. */
  121. status = fx_file_create(&ram_disk, "TEST.TXT");
  122. status += fx_file_create(&ram_disk, "OPENED_FOR_WRITE.TXT");
  123. status += fx_file_create(&ram_disk, "NOT_OPENED.TXT");
  124. /* Check the create status. */
  125. if (status != FX_SUCCESS)
  126. {
  127. printf("ERROR!\n");
  128. test_control_return(5);
  129. }
  130. /* test error checking */
  131. #ifndef FX_DISABLE_ERROR_CHECKING
  132. /* send a null pointer to generate an error */
  133. status = fx_directory_information_get(&ram_disk, "DOES_NOT_EXIST", FX_NULL, FX_NULL,
  134. FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL, FX_NULL);
  135. if (status != FX_PTR_ERROR)
  136. {
  137. printf("ERROR!\n");
  138. test_control_return(6);
  139. }
  140. /* send null pointer to generate an error */
  141. status = fx_file_date_time_set(FX_NULL, "TEST.TXT", 0, 0, 0, 0, 0, 0);
  142. if (status != FX_PTR_ERROR)
  143. {
  144. printf("ERROR!\n");
  145. test_control_return(7);
  146. }
  147. /* send an invalid year to generate an error */
  148. status = fx_file_date_time_set(&ram_disk, "TEST.TXT", 0, 0, 0, 0, 0, 0);
  149. if (status != FX_INVALID_YEAR)
  150. {
  151. printf("ERROR!\n");
  152. test_control_return(8);
  153. }
  154. /* send an invalid month to generate an error */
  155. status = fx_file_date_time_set(&ram_disk, "TEST.TXT", 2015, 0, 1, 0, 0, 0);
  156. if (status != FX_INVALID_MONTH)
  157. {
  158. printf("ERROR!\n");
  159. test_control_return(9);
  160. }
  161. /* send a valid and invalid day for each month to generate an error */
  162. for (i = 1; i <= 12; i++)
  163. {
  164. status = fx_file_date_time_set(&ram_disk, "TEST.TXT", 2015, i, 0, 0, 0, 0);
  165. if (status != FX_INVALID_DAY)
  166. {
  167. printf("ERROR!\n");
  168. test_control_return(10);
  169. }
  170. status = fx_file_date_time_set(&ram_disk, "TEST.TXT", 2015, i, 1, 1, 1, 1);
  171. if (status != FX_SUCCESS)
  172. {
  173. printf("ERROR!\n");
  174. test_control_return(11);
  175. }
  176. }
  177. /* send an invalid day for feb of a leap year */
  178. status = fx_file_date_time_set(&ram_disk, "TEST.TXT", 2016, 2, 0, 0, 0, 0);
  179. if (status != FX_INVALID_DAY)
  180. {
  181. printf("ERROR!\n");
  182. test_control_return(12);
  183. }
  184. /* send an invalid hour to generate an error */
  185. status = fx_file_date_time_set(&ram_disk, "TEST.TXT", 2000, 1, 1, 99, 0, 0);
  186. if (status != FX_INVALID_HOUR)
  187. {
  188. printf("ERROR!\n");
  189. test_control_return(13);
  190. }
  191. /* send an invalid minute to generate an error */
  192. status = fx_file_date_time_set(&ram_disk, "TEST.TXT", 2000, 1, 1, 1, 99, 0);
  193. if (status != FX_INVALID_MINUTE)
  194. {
  195. printf("ERROR!\n");
  196. test_control_return(14);
  197. }
  198. /* send an invalid second to generate an error */
  199. status = fx_file_date_time_set(&ram_disk, "TEST.TXT", 2000, 1, 1, 1, 1, 99);
  200. if (status != FX_INVALID_SECOND)
  201. {
  202. printf("ERROR!\n");
  203. test_control_return(15);
  204. }
  205. #endif
  206. /* Attempt to set the date and time for a file that does not exist to generate an error */
  207. status = fx_file_date_time_set(&ram_disk, "DOES_NOT_EXIST", 2000, 1, 1, 1, 1, 1);
  208. if (status == FX_SUCCESS)
  209. {
  210. printf("ERROR!\n");
  211. test_control_return(16);
  212. }
  213. /* Invalidate the media cache. */
  214. fx_media_cache_invalidate(&ram_disk);
  215. /* Set the date and time for the file. */
  216. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  217. 1999, 12, 31, 23, 59, 58);
  218. /* Check the date/time set status. */
  219. if (status != FX_SUCCESS)
  220. {
  221. printf("ERROR!\n");
  222. test_control_return(17);
  223. }
  224. /* try to retrieve directory information for something that doesnt exist to generate an error */
  225. status = fx_directory_information_get(&ram_disk, "DOES_NOT_EXIST", &attributes, &size,
  226. &year, &month, &day, &hour, &minute, &second);
  227. if (status == FX_SUCCESS)
  228. {
  229. printf("ERROR!\n");
  230. test_control_return(18);
  231. }
  232. /* Invalidate the media cache. */
  233. fx_media_cache_invalidate(&ram_disk);
  234. /* Now pickup the date/time for the file. */
  235. status = fx_directory_information_get(&ram_disk, "TEST.TXT", &attributes, &size,
  236. &year, &month, &day, &hour, &minute, &second);
  237. /* Check the date/time status. */
  238. if ((status != FX_SUCCESS) || (attributes != FX_ARCHIVE) || (size != 0) ||
  239. (year != 1999) || (month != 12) || (day != 31) || (hour != 23) || (minute != 59) || (second != 58))
  240. {
  241. printf("ERROR!\n");
  242. test_control_return(19);
  243. }
  244. /* get the date/time for the other files while some are opened to get better code coverage */
  245. status = fx_file_open(&ram_disk, &my_file, "OPENED_FOR_WRITE.TXT", FX_OPEN_FOR_WRITE);
  246. status += fx_directory_information_get(&ram_disk, "OPENED_FOR_WRITE.TXT", &attributes, &size,
  247. &year, &month, &day, &hour, &minute, &second);
  248. status += fx_directory_information_get(&ram_disk, "NOT_OPENED.TXT", &attributes, &size,
  249. &year, &month, &day, &hour, &minute, &second);
  250. if (status != FX_SUCCESS)
  251. {
  252. printf("ERROR!\n");
  253. test_control_return(20);
  254. }
  255. /* Close the media. */
  256. status = fx_media_close(&ram_disk);
  257. /* Determine if the test was successful. */
  258. if (status != FX_SUCCESS)
  259. {
  260. printf("ERROR!\n");
  261. test_control_return(21);
  262. }
  263. #ifndef FX_DISABLE_ERROR_CHECKING
  264. /* Set the date and time for with an invalid file name. */
  265. status = fx_file_date_time_set(&ram_disk, NULL,
  266. 1999, 12, 31, 23, 59, 58);
  267. /* Check the date/time set status. */
  268. if (status != FX_PTR_ERROR)
  269. {
  270. printf("ERROR!\n");
  271. test_control_return(22);
  272. }
  273. /* Set the date and time for with an invalid year. */
  274. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  275. FX_MAXIMUM_YEAR+1, 12, 31, 23, 59, 58);
  276. /* Check the date/time set status. */
  277. if (status != FX_INVALID_YEAR)
  278. {
  279. printf("ERROR!\n");
  280. test_control_return(23);
  281. }
  282. /* Set the date and time for with an invalid day for January. */
  283. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  284. 2016, 1, 32, 23, 59, 58);
  285. /* Check the date/time set status. */
  286. if (status != FX_INVALID_DAY)
  287. {
  288. printf("ERROR!\n");
  289. test_control_return(24);
  290. }
  291. /* Set the date and time for with an invalid day for Febuary leap year. */
  292. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  293. 2016, 2, 30, 23, 59, 58);
  294. /* Check the date/time set status. */
  295. if (status != FX_INVALID_DAY)
  296. {
  297. printf("ERROR!\n");
  298. test_control_return(25);
  299. }
  300. /* Set the date and time for with a valid day for Febuary leap year. */
  301. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  302. 2016, 2, 29, 24, 59, 58);
  303. /* Check the date/time set status. */
  304. if (status != FX_INVALID_HOUR)
  305. {
  306. printf("ERROR!\n");
  307. test_control_return(26);
  308. }
  309. /* Set the date and time for with an invalid day for Febuary. */
  310. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  311. 2017, 2, 29, 23, 59, 58);
  312. /* Check the date/time set status. */
  313. if (status != FX_INVALID_DAY)
  314. {
  315. printf("ERROR!\n");
  316. test_control_return(27);
  317. }
  318. /* Set the date and time for with an invalid day for March. */
  319. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  320. 2017, 3, 32, 23, 59, 58);
  321. /* Check the date/time set status. */
  322. if (status != FX_INVALID_DAY)
  323. {
  324. printf("ERROR!\n");
  325. test_control_return(28);
  326. }
  327. /* Set the date and time for with an invalid day for April. */
  328. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  329. 2017, 4, 31, 23, 59, 58);
  330. /* Check the date/time set status. */
  331. if (status != FX_INVALID_DAY)
  332. {
  333. printf("ERROR!\n");
  334. test_control_return(29);
  335. }
  336. /* Set the date and time for with an invalid day for May. */
  337. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  338. 2017, 5, 32, 23, 59, 58);
  339. /* Check the date/time set status. */
  340. if (status != FX_INVALID_DAY)
  341. {
  342. printf("ERROR!\n");
  343. test_control_return(30);
  344. }
  345. /* Set the date and time for with an invalid day for June. */
  346. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  347. 2017, 6, 31, 23, 59, 58);
  348. /* Check the date/time set status. */
  349. if (status != FX_INVALID_DAY)
  350. {
  351. printf("ERROR!\n");
  352. test_control_return(31);
  353. }
  354. /* Set the date and time for with an invalid day for July. */
  355. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  356. 2017, 7, 32, 23, 59, 58);
  357. /* Check the date/time set status. */
  358. if (status != FX_INVALID_DAY)
  359. {
  360. printf("ERROR!\n");
  361. test_control_return(32);
  362. }
  363. /* Set the date and time for with an invalid day for August. */
  364. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  365. 2017, 8, 32, 23, 59, 58);
  366. /* Check the date/time set status. */
  367. if (status != FX_INVALID_DAY)
  368. {
  369. printf("ERROR!\n");
  370. test_control_return(33);
  371. }
  372. /* Set the date and time for with an invalid day for September. */
  373. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  374. 2017, 9, 31, 23, 59, 58);
  375. /* Check the date/time set status. */
  376. if (status != FX_INVALID_DAY)
  377. {
  378. printf("ERROR!\n");
  379. test_control_return(34);
  380. }
  381. /* Set the date and time for with an invalid day for October. */
  382. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  383. 2017, 10, 32, 23, 59, 58);
  384. /* Check the date/time set status. */
  385. if (status != FX_INVALID_DAY)
  386. {
  387. printf("ERROR!\n");
  388. test_control_return(35);
  389. }
  390. /* Set the date and time for with an invalid day for November. */
  391. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  392. 2017, 11, 31, 23, 59, 58);
  393. /* Check the date/time set status. */
  394. if (status != FX_INVALID_DAY)
  395. {
  396. printf("ERROR!\n");
  397. test_control_return(36);
  398. }
  399. /* Set the date and time for with an invalid day for December. */
  400. status = fx_file_date_time_set(&ram_disk, "TEST.TXT",
  401. 2017, 12, 32, 23, 59, 58);
  402. /* Check the date/time set status. */
  403. if (status != FX_INVALID_DAY)
  404. {
  405. printf("ERROR!\n");
  406. test_control_return(37);
  407. }
  408. #endif
  409. /* Format the media. This needs to be done before opening it! */
  410. status = fx_media_format(&ram_disk,
  411. _fx_ram_driver, // Driver entry
  412. ram_disk_memory, // RAM disk memory pointer
  413. cache_buffer, // Media buffer pointer
  414. CACHE_SIZE, // Media buffer size
  415. "MY_RAM_DISK", // Volume Name
  416. 1, // Number of FATs
  417. 64, // Directory Entries
  418. 0, // Hidden sectors
  419. 4096, // Total sectors
  420. 128, // Sector size
  421. 1, // Sectors per cluster
  422. 1, // Heads
  423. 1); // Sectors per track
  424. /* Determine if the format had an error. */
  425. if (status)
  426. {
  427. printf("ERROR!\n");
  428. test_control_return(38);
  429. }
  430. /* Open the ram_disk. */
  431. status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, cache_buffer, CACHE_SIZE);
  432. /* Check the status. */
  433. if (status != FX_SUCCESS)
  434. {
  435. /* Error, return error code. */
  436. printf("ERROR!\n");
  437. test_control_return(39);
  438. }
  439. /* Create a bunch of files. */
  440. status = fx_file_create(&ram_disk, "TEST.TXT");
  441. status += fx_file_create(&ram_disk, "TEST1.TXT");
  442. status += fx_file_create(&ram_disk, "TEST2.TXT");
  443. status += fx_file_create(&ram_disk, "TEST3.TXT");
  444. status += fx_file_create(&ram_disk, "TEST4.TXT");
  445. status += fx_file_create(&ram_disk, "TEST5.TXT");
  446. status += fx_file_create(&ram_disk, "TEST6.TXT");
  447. status += fx_file_create(&ram_disk, "TEST7.TXT");
  448. status += fx_file_create(&ram_disk, "TEST8.TXT");
  449. status += fx_file_create(&ram_disk, "TEST9.TXT");
  450. status += fx_file_create(&ram_disk, "TEST10.TXT");
  451. status += fx_file_create(&ram_disk, "TEST11.TXT");
  452. status += fx_file_create(&ram_disk, "TEST12.TXT");
  453. status += fx_file_create(&ram_disk, "TEST13.TXT");
  454. status += fx_file_create(&ram_disk, "TEST14.TXT");
  455. status += fx_file_create(&ram_disk, "TEST15.TXT");
  456. status += fx_file_create(&ram_disk, "TEST16.TXT");
  457. status += fx_file_create(&ram_disk, "TEST17.TXT");
  458. status += fx_file_create(&ram_disk, "TEST18.TXT");
  459. status += fx_file_create(&ram_disk, "TEST19.TXT");
  460. status += fx_file_create(&ram_disk, "TEST20.TXT");
  461. status += fx_file_create(&ram_disk, "TEST21.TXT");
  462. status += fx_file_create(&ram_disk, "TEST22.TXT");
  463. status += fx_file_create(&ram_disk, "TEST23.TXT");
  464. status += fx_file_create(&ram_disk, "TEST24.TXT");
  465. status += fx_file_create(&ram_disk, "TEST25.TXT");
  466. status += fx_file_create(&ram_disk, "TEST26.TXT");
  467. status += fx_file_create(&ram_disk, "TEST27.TXT");
  468. status += fx_file_create(&ram_disk, "TEST28.TXT");
  469. status += fx_file_create(&ram_disk, "TEST29.TXT");
  470. status += fx_file_create(&ram_disk, "TEST30.TXT");
  471. status += fx_file_create(&ram_disk, "TEST31.TXT");
  472. /* Now open a set of files so we get all combinations through the open count check in fx_directory_information_get.c. */
  473. status += fx_file_open(&ram_disk, &file_0, "TEST.TXT", FX_OPEN_FOR_READ);
  474. status += fx_file_open(&ram_disk, &file_1, "TEST1.TXT", FX_OPEN_FOR_WRITE);
  475. status += fx_file_open(&ram_disk, &file_2, "TEST2.TXT", FX_OPEN_FOR_WRITE);
  476. status += fx_file_open(&ram_disk, &file_3, "TEST9.TXT", FX_OPEN_FOR_WRITE);
  477. status += fx_file_open(&ram_disk, &file_4, "TEST11.TXT", FX_OPEN_FOR_WRITE);
  478. status += fx_file_open(&ram_disk, &file_5, "TEST19.TXT", FX_OPEN_FOR_WRITE);
  479. status += fx_file_open(&ram_disk, &file_6, "TEST30.TXT", FX_OPEN_FOR_WRITE);
  480. /* Now get information on the first file... requesting on the "second" parameter. */
  481. status += fx_directory_information_get(&ram_disk, "TEST.TXT", FX_NULL, FX_NULL,
  482. FX_NULL, FX_NULL, FX_NULL,
  483. FX_NULL, FX_NULL, &second);
  484. /* Determine if there was an error. */
  485. if (status != FX_SUCCESS)
  486. {
  487. printf("ERROR!\n");
  488. test_control_return(40);
  489. }
  490. /* Now get information on the first file... requesting on the "minute" parameter. */
  491. status += fx_directory_information_get(&ram_disk, "TEST.TXT", FX_NULL, FX_NULL,
  492. FX_NULL, FX_NULL, FX_NULL,
  493. FX_NULL, &minute, FX_NULL);
  494. /* Determine if there was an error. */
  495. if (status != FX_SUCCESS)
  496. {
  497. printf("ERROR!\n");
  498. test_control_return(41);
  499. }
  500. /* Close the media. */
  501. status = fx_media_close(&ram_disk);
  502. /* Determine if there was an error. */
  503. if (status != FX_SUCCESS)
  504. {
  505. printf("ERROR!\n");
  506. test_control_return(42);
  507. }
  508. else
  509. {
  510. printf("SUCCESS!\n");
  511. test_control_return(0);
  512. }
  513. }