diff --git a/AutomatedTests/CMakeLists.txt b/AutomatedTests/CMakeLists.txt index 3e670a38a0..e07c21bf98 100644 --- a/AutomatedTests/CMakeLists.txt +++ b/AutomatedTests/CMakeLists.txt @@ -86,3 +86,5 @@ test(Exceptions.cc PROPERTIES PASS_REGULAR_EXPRESSION "OK") configure_file(PascalTrap.c PascalTrapCPP.cc) test(PascalTrap.c PROPERTIES PASS_REGULAR_EXPRESSION "OK") test(${CMAKE_CURRENT_BINARY_DIR}/PascalTrapCPP.cc PROPERTIES PASS_REGULAR_EXPRESSION "OK") + +test(PascalString.c PROPERTIES PASS_REGULAR_EXPRESSION "OK") diff --git a/AutomatedTests/PascalString.c b/AutomatedTests/PascalString.c new file mode 100644 index 0000000000..15c825e063 --- /dev/null +++ b/AutomatedTests/PascalString.c @@ -0,0 +1,25 @@ +#include "Test.h" + +int main() +{ + const unsigned char *pstr = "\pHello, world."; + const char *cstr = "Hello, world."; + + if (pstr[0] != 13) + { + TEST_LOG_NO(); + return 1; + } + + for (int i = 0; cstr[i]; ++i) + { + if (cstr[i] != (char) pstr[i+1]) + { + TEST_LOG_NO(); + return 1; + } + } + + TEST_LOG_OK(); + return 0; +}