After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 673216 - [W32] gtestutils does not use path separators consistently
[W32] gtestutils does not use path separators consistently
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.32.x
Other Windows
: Normal major
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-03-31 01:01 UTC by LRN
Modified: 2012-04-07 00:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A very complex patch fox rectifying the issue (388 bytes, patch)
2012-03-31 02:56 UTC, LRN
none Details | Review
Always use '/' in test paths (1.56 KB, patch)
2012-04-07 00:51 UTC, Matthias Clasen
committed Details | Review
Don't return values from void functions (1.06 KB, patch)
2012-04-07 00:51 UTC, Matthias Clasen
committed Details | Review

Description LRN 2012-03-31 01:01:24 UTC
GTest documentation shows "/" being used as path separator when calling g_test_add_func().
g_test_create_case() checks that its first argument contains no "/" and fails if that is not so.
Tests often (always?) use "/" explicitly for testpaths when calling g_test_add_func().
g_test_add_vtable() uses G_DIR_SEPARATOR_S to split its first argument.
On W32 G_DIR_SEPARATOR_S is defined to "\\".
At least one test (tests/gobject/gvalue-test) fails because of that.

Fix: either mandate the use of "/" and modify g_test_add_vtable() to use "/", or mandate the use of G_DIR_SEPARATOR_S and use it in g_test_create_case() and in testcases
Comment 1 LRN 2012-03-31 02:56:29 UTC
Created attachment 211013 [details] [review]
A very complex patch fox rectifying the issue
Comment 2 LRN 2012-03-31 02:57:39 UTC
Attached a very complex patch for rectifying the issue. Applies on top of glib-2.32.0. Please, review it very carefully before applying, as it might break the whole testing API.
Comment 3 Matthias Clasen 2012-04-07 00:51:32 UTC
The following fixes have been pushed:
8db4b94 Always use '/' in test paths
e52cf81 Don't return values from void functions
Comment 4 Matthias Clasen 2012-04-07 00:51:34 UTC
Created attachment 211520 [details] [review]
Always use '/' in test paths

It does not make much sense to use a platform-dependent
directory separator in these strings, since they are not
filesystem paths.
Comment 5 Matthias Clasen 2012-04-07 00:51:37 UTC
Created attachment 211521 [details] [review]
Don't return values from void functions

Sun CC does not take that lightly.