summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2010-03-26 10:41:24 +0100
committerMurray Cumming <murrayc@murrayc.com>2010-03-26 10:41:24 +0100
commit00f67118a394e743de6b87338397f2e833260495 (patch)
tree68071b8a7560d5e37d0c46388abacd31e161a529
parent94cde38dd2beb67bb97a37245168ce3a14b51ae2 (diff)
downloadglibmm-00f67118a394e743de6b87338397f2e833260495.tar.gz
Add regression test for Bug #613250.
* tests/Makefile.am * tests/glibmm_ustring_format/main.cc: Added a regression test for the previously-commited fix, based on code in bug #613250 from Debarshi Ray.
-rw-r--r--ChangeLog8
-rw-r--r--gio/src/gio_enums.defs3
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/glibmm_ustring_format/main.cc28
4 files changed, 41 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index fdc2dfde..49f7dd17 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-03-26 Murray Cumming <murrayc@murrayc.com>
+
+ Add regression test for Bug #613250.
+
+ * tests/Makefile.am
+ * tests/glibmm_ustring_format/main.cc: Added a regression test for the
+ previously-commited fix, based on code in bug #613250 from Debarshi Ray.
+
2010-03-20 Debarshi Ray <debarshir@src.gnome.org>
Bug #613250 - Overload Glib::ustring::FormatStream::stream for char *.
diff --git a/gio/src/gio_enums.defs b/gio/src/gio_enums.defs
index 2c2e4a0f..accf1bc2 100644
--- a/gio/src/gio_enums.defs
+++ b/gio/src/gio_enums.defs
@@ -405,6 +405,7 @@
(values
'("failed" "G_IO_ERROR_FAILED" "0")
'("not-found" "G_IO_ERROR_NOT_FOUND" "1")
+
'("exists" "G_IO_ERROR_EXISTS" "2")
'("is-directory" "G_IO_ERROR_IS_DIRECTORY" "3")
'("not-directory" "G_IO_ERROR_NOT_DIRECTORY" "4")
@@ -432,6 +433,7 @@
'("busy" "G_IO_ERROR_BUSY" "26")
'("would-block" "G_IO_ERROR_WOULD_BLOCK" "27")
'("host-not-found" "G_IO_ERROR_HOST_NOT_FOUND" "28")
+ '("host-not-found" "G_IO_ERROR_HOST_WAS_NOT_FOUND" "28")
'("would-merge" "G_IO_ERROR_WOULD_MERGE" "29")
'("failed-handled" "G_IO_ERROR_FAILED_HANDLED" "30")
'("too-many-open-files" "G_IO_ERROR_TOO_MANY_OPEN_FILES" "31")
@@ -648,4 +650,3 @@
'("raw" "G_ZLIB_COMPRESSOR_FORMAT_RAW" "2")
)
)
-
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c9c02658..cb032368 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -25,8 +25,9 @@ check_PROGRAMS = \
glibmm_date/test \
glibmm_nodetree/test \
glibmm_ustring_compose/test \
+ glibmm_ustring_format/test \
glibmm_value/test \
- glibmm_valuearray/test
+ glibmm_valuearray/test
glibmm_includes = -I$(top_builddir)/glib $(if $(srcdir:.=),-I$(top_srcdir)/glib)
giomm_includes = -I$(top_builddir)/gio $(if $(srcdir:.=),-I$(top_srcdir)/gio)
@@ -54,5 +55,6 @@ glibmm_btree_test_SOURCES = glibmm_btree/main.cc
glibmm_date_test_SOURCES = glibmm_date/main.cc
glibmm_nodetree_test_SOURCES = glibmm_nodetree/main.cc
glibmm_ustring_compose_test_SOURCES = glibmm_ustring_compose/main.cc
+glibmm_ustring_format_test_SOURCES = glibmm_ustring_format/main.cc
glibmm_value_test_SOURCES = glibmm_value/glibmm_value.cc glibmm_value/main.cc
glibmm_valuearray_test_SOURCES = glibmm_valuearray/main.cc
diff --git a/tests/glibmm_ustring_format/main.cc b/tests/glibmm_ustring_format/main.cc
new file mode 100644
index 00000000..1d5dc92d
--- /dev/null
+++ b/tests/glibmm_ustring_format/main.cc
@@ -0,0 +1,28 @@
+#include <glibmm.h>
+
+#include <iostream>
+
+int main(int, char**)
+{
+ Glib::init();
+
+ char carr[10] = "UÅūduotys";
+ char * const cptr = carr;
+
+ std::wostringstream wsout;
+ wsout << carr;
+ const std::wstring& wstr = wsout.str();
+ const gunichar * const data = reinterpret_cast<const gunichar *>(
+ wstr.data());
+
+ //for(int i = 0; wstr.size() > i; ++i)
+ // std::cout << data[i] << std::endl;
+
+ //Check both the const char* and char* versions.
+ Glib::ustring::format(carr);
+
+ //This threw an exception before we added a ustring::FormatStream::stream(char*) overload.
+ Glib::ustring::format(cptr);
+
+ return 0;
+}