test-stringutils.c 619 B

12345678910111213141516171819202122232425262728
  1. #include "ds/stringutils.h"
  2. #include "util/tester.h"
  3. #include <stdio.h>
  4. int
  5. main ( int argc, char * argv[] )
  6. {
  7. (void)argc;
  8. (void)argv;
  9. string * teststring = SU_new(SU_MAX_PATH_LENGTH);
  10. SEx_TestBool( "SU_new", teststring != NULL, true );
  11. SU_free(teststring);
  12. SEx_TestBool( "SU_free", true, true );
  13. teststring = SU_new(SU_MAX_PATH_LENGTH);
  14. SU_set( teststring, "123" );
  15. SEx_TestLines( "SU_set", teststring->s, "123" );
  16. SU_cat( teststring, "4" );
  17. SEx_TestLines( "SU_cat", teststring->s, "1234" );
  18. SU_free(teststring);
  19. teststring = SU_simple("aaa");
  20. SEx_TestLines( "SU_simple", teststring->s, "aaa" );
  21. }