]> git.draconx.ca Git - gob-dx.git/blobdiff - src/str_test.c
Release 2.0.16
[gob-dx.git] / src / str_test.c
diff --git a/src/str_test.c b/src/str_test.c
new file mode 100644 (file)
index 0000000..12a1be9
--- /dev/null
@@ -0,0 +1,20 @@
+#include "str.h"
+
+int
+main (void)
+{
+  g_type_init ();
+
+  int the_answer = 42;
+  char *stupid_pointer = "ug";
+
+  // This works fine.
+  Str *test_good = (Str *) (str_new ("%d", the_answer));
+  test_good = test_good;
+
+  // This gets a warning thanks to our function attribute.
+  Str *test_bad = (Str *) (str_new ("%d", stupid_pointer));
+  test_bad = test_bad;
+
+  return 0;
+}