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 508346 - Use GLib test API
Use GLib test API
Status: RESOLVED FIXED
Product: totem-pl-parser
Classification: Core
Component: General
2.23.x
Other Linux
: Normal enhancement
: ---
Assigned To: totem-pl-parser-maint
totem-pl-parser-maint
Depends on:
Blocks:
 
 
Reported: 2008-01-09 17:48 UTC by Philip Withnall
Modified: 2009-03-16 22:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Convert totem-pl-parser to use GTest API (395.77 KB, patch)
2008-12-08 23:19 UTC, Philip Withnall
reviewed Details | Review
Convert totem-pl-parser to use GTest API (updated) (399.37 KB, patch)
2008-12-11 18:46 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2008-01-09 17:48:24 UTC
We could use the GLib test API for the parser tests, and make it run on `make check`.
Comment 1 Philip Withnall 2008-12-08 23:19:40 UTC
Created attachment 124216 [details] [review]
Convert totem-pl-parser to use GTest API

This converts all the old tests to the new API, keeping as much as possible. I've rewritten them somewhat so they're more automated, and removed some output from them (relying on assertions instead).

I've commented out all the tests for totem_pl_parser_relative, since it's a function private to totem-pl-parser, and is relatively simple anyway. Would it be OK to remove these tests altogether?

Not all of the tests pass at the moment, so that needs to be fixed (either here or in the relevant plparser code).
Comment 2 Bastien Nocera 2008-12-09 00:44:00 UTC
One big problem though, the test-parser and disc-test were also very useful for "by-hand" debugging, without the need for recompilation.

That ability needs to be kept (even if it means sharing some of the code with the GTester backend). Otherwise looks good to me.
Comment 3 Philip Withnall 2008-12-11 18:46:04 UTC
Created attachment 124445 [details] [review]
Convert totem-pl-parser to use GTest API (updated)

This adds back in most of the command-line options to ./disc and ./parser, maintaining feature parity with the old versions.

I still need to know what to do with the totem_pl_parser_relative tests.
Comment 4 Bastien Nocera 2009-02-17 15:52:43 UTC
Why is it a problem that totem_pl_parser_relative() is a semi-private function? It's exported in the -private.h header, and exported through the symbols...
Comment 5 Philip Withnall 2009-03-14 21:02:08 UTC
OK, I'll uncomment the relative tests (which work). Should I then commit, after branching?
Comment 6 Bastien Nocera 2009-03-16 10:23:25 UTC
Yeah, go for it.
Comment 7 Philip Withnall 2009-03-16 22:13:44 UTC
2009-03-16  Philip Withnall  <philip@tecnocode.co.uk>

	* Makefile.decl:
	* configure.in:
	* plparse/Makefile.am:
	* plparse/disc-test.c:
	* plparse/test-parser.c:
	* plparse/tests/541405.xml:
	* plparse/tests/560051.xml:
	* plparse/tests/Makefile.am:
	* plparse/tests/disc.c:
	* plparse/tests/parser.c: Convert totem-pl-parser to use the GTest
	API for its test suite. The test suite has also been improved a
	little, and is consequently more automated. Feature parity with the
	old code for manually testing discs is maintained. (Closes: #508346)