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 681120 - gnutls: More tests for GTlsFileDatabaseGnutls
gnutls: More tests for GTlsFileDatabaseGnutls
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: network
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on: 681119 681149
Blocks:
 
 
Reported: 2012-08-03 09:49 UTC by Stef Walter
Modified: 2012-08-03 16:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gnutls: More tests for GTlsFileDatabaseGnutls (9.42 KB, patch)
2012-08-03 09:49 UTC, Stef Walter
committed Details | Review

Description Stef Walter 2012-08-03 09:49:03 UTC
Complete basic code coverage for that file before making more
changes.
Comment 1 Stef Walter 2012-08-03 09:49:06 UTC
Created attachment 220219 [details] [review]
gnutls: More tests for GTlsFileDatabaseGnutls

 * Check the properties
 * Check looking up certificates by issuer
Comment 2 Dan Winship 2012-08-03 14:46:18 UTC
Comment on attachment 220219 [details] [review]
gnutls: More tests for GTlsFileDatabaseGnutls

>+  const guchar ISSUER[] = "\x30\x81\x86\x31\x13\x30\x11\x06\x0A\x09\x92\x26\x89\x93\xF2"
>+                          "\x2C\x64\x01\x19\x16\x03\x43\x4F\x4D\x31\x17\x30\x15\x06\x0A"

We may want to replace the test certificates at some point (eg, to add some new extension/attribute/whatever), in which case it would be nice to have a hint as to how to regenerate this value...

>+  g_assert (certificate_is_in_list (certificates, TEST_FILE ("server.pem")));

I know you already checked the length of the list, but I'd add

    g_assert (!certificate_is_in_list (certificates, TEST_FILE ("server-self.pem")));

just for extra sanity-checking

(OK to commit with those changes)
Comment 3 Stef Walter 2012-08-03 16:05:24 UTC
Dan, can you give a quick review for the the bug in gcr that this depends on?
Comment 4 Stef Walter 2012-08-03 16:05:37 UTC
Comment on attachment 220219 [details] [review]
gnutls: More tests for GTlsFileDatabaseGnutls

Committed with changes.