y_text_tests.inc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. loadtext test[ysi_test];
  2. TEST__ y_text_formatex_cellmin_d()
  3. {
  4. static
  5. result[] = "-2147483648";
  6. TextTest_Reset();
  7. Text_FormatEx(YSI_gTextTestOutput[0], MAX_Y_TEXT_TEST_LENGTH, "%d", cellmin);
  8. P:3("y_text_formatex_cellmin_d:\r\n player: %d\r\n colour: %04x%04x\r\n output: \"%s\"", YSI_gTextTestPlayer[0], YSI_gTextTestStyle[0] >>> 16, YSI_gTextTestStyle[0] & 0xFFFF, YSI_gTextTestOutput[0]);
  9. ASSERT(YSI_gTextTestOutput[0][0] && !strcmp(YSI_gTextTestOutput[0], result));
  10. }
  11. TEST__ y_text_formatex_cellmin_x()
  12. {
  13. static
  14. result[] = "80000000";
  15. TextTest_Reset();
  16. Text_FormatEx(YSI_gTextTestOutput[0], MAX_Y_TEXT_TEST_LENGTH, "%x", cellmin);
  17. P:3("y_text_formatex_cellmin_x:\r\n player: %d\r\n colour: %04x%04x\r\n output: \"%s\"", YSI_gTextTestPlayer[0], YSI_gTextTestStyle[0] >>> 16, YSI_gTextTestStyle[0] & 0xFFFF, YSI_gTextTestOutput[0]);
  18. ASSERT(YSI_gTextTestOutput[0][0] && !strcmp(YSI_gTextTestOutput[0], result));
  19. }
  20. TEST__ y_text_formatex_cellmin_b()
  21. {
  22. static
  23. result[] = "10000000000000000000000000000000";
  24. TextTest_Reset();
  25. Text_FormatEx(YSI_gTextTestOutput[0], MAX_Y_TEXT_TEST_LENGTH, "%b", cellmin);
  26. P:3("y_text_formatex_cellmin_b:\r\n player: %d\r\n colour: %04x%04x\r\n output: \"%s\"", YSI_gTextTestPlayer[0], YSI_gTextTestStyle[0] >>> 16, YSI_gTextTestStyle[0] & 0xFFFF, YSI_gTextTestOutput[0]);
  27. ASSERT(YSI_gTextTestOutput[0][0] && !strcmp(YSI_gTextTestOutput[0], result));
  28. }
  29. TEST__ y_text_Text_Send_1()
  30. {
  31. static
  32. result[] = "Hello World";
  33. TextTest_Reset();
  34. Text_Send(42, Language:0, $TEST_STRING_C, "World");
  35. P:3("y_text_Text_Send_1:\r\n player: %d\r\n colour: %04x%04x\r\n output: \"%s\"", YSI_gTextTestPlayer[0], YSI_gTextTestStyle[0] >>> 16, YSI_gTextTestStyle[0] & 0xFFFF, YSI_gTextTestOutput[0]);
  36. ASSERT(YSI_gTextTestOutput[0][0] && !strcmp(YSI_gTextTestOutput[0], result));
  37. }