Created SILC Runtime Toolkit git repository Part II.
[runtime.git] / lib / silcutil / tests / test_silcbuffmt.c
index 052be536edc8460f2a1535ad900d8d05682409bb..6e856e974e743e1b7f102104d18d0b224e172002 100644 (file)
@@ -1,6 +1,6 @@
 /* Buffer formatting tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 int print(SilcStack stack, SilcBuffer buf, void *value, void *context)
 {
@@ -46,7 +46,7 @@ int main(int argc, char **argv)
   if (silc_buffer_format(&buf,
                         SILC_STR_REGEX("foo", SILC_STR_REGEX_ALL |
                                               SILC_STR_REGEX_INCLUSIVE),
-                          SILC_STR_STRING_APPEND("barbar"),
+                          SILC_STR_REPLACE("barbar", 6),
                         SILC_STR_END,
                         SILC_STR_END) < 0)
     goto err;
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
   if (silc_buffer_format(&buf,
                         SILC_STR_REGEX("foo", SILC_STR_REGEX_ALL |
                                               SILC_STR_REGEX_INCLUSIVE),
-                          SILC_STR_DELETE(-1),
+                          SILC_STR_REPLACE("", 0),
                         SILC_STR_END,
                         SILC_STR_END) < 0)
     goto err;
@@ -153,5 +153,5 @@ int main(int argc, char **argv)
   SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
   fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
 
-  return success;
+  return !success;
 }