[lsb-discuss] GdkGeneral test fail

Stew Benedict stewb at linux-foundation.org
Fri Jan 11 04:18:44 PST 2008

On Fri, 11 Jan 2008, Andrius Tsen wrote:

> Hello,
> I ran LSB 3.0 test on RHEL4 Update 5 and RHEL5, things went well on RHEL5,
> but there are
> a lot of test fails on GTK test.
> The first fail is GdkGeneral,  error message in test report is
> test case:
> /opt/lsb/test/desktop/gtkvts/tet_tmp_dir/15063aa/tests/functions/GdkGeneral/GdkGeneral,
> TP number: 2
> GdkGeneral.c, line 145:
> gdk_get_program_class: failed
> Then i check out the lsb-gtkvts source code from your bzr lsb devel
> repository, compile the this case and rerun it singlely,
> tet_xres files contains following:
> 15|0 3.7-lite 1|TCM Start
> 400|0 1 2 08:54:14|IC Start
> 200|0 1 08:54:14|TP Start
> 520|0 1 00017581 1 1|test case: ./GdkGeneral, TP number: 1
> 220|0 1 0 08:54:14|PASS
> 200|0 2 08:54:14|TP Start
> 520|0 2 00017581 1 1|test case: ./GdkGeneral, TP number: 2
> 520|0 2 00017581 1 2|GdkGeneral.c, line 145:
> 520|0 2 00017581 1 3|gdk_get_program_class: failed
> 220|0 2 1 08:54:14|FAIL
> 410|0 1 2 08:54:14|IC End
> Seems the same issue as first run, then i copy the compiled binary file to
> RHEL5 box, 2 Passed, no fail.
>     143
>     144     if (strcmp(gdk_get_program_class(), ".") != 0){
>     145         TEST_FAIL("gdk_get_program_class: failed", NULL);
>     146     }
> A glance into the source code, add a debuging tet_printf , found the
> gdk_get_program_class() actually return an
> empty string, not a "." on RHEL4U5 box compared to RHEL5, so the test
> failed.
> The gtk2 package is gtk2-2.4.13-22 on RHEL4U5 and gtk2-2.10.4-16 on RHEL5,
> i don't know whether
> the gdk_get_program_class return differently on different version in the
> same testcase.
> Is this a TSD or something else?

I don't recall seeing this particular case before. It may just be behavioral 
differences with 2.4.x. The LSB spec and tests are based on 2.6, I 
believe, and the navigator says these came in with LSB 3.1.

Reference spec:


gdk_get_program_class ()

const char* gdk_get_program_class           (void);

Gets the program class. Unless the program class has explicitly been set 
with gdk_set_program_class() or with the --class commandline option, the 
default value is the program name (determined with g_get_prgname()) with 
the first character converted to uppercase.

Returns:	the program class. 

g_get_prgname ()

gchar*      g_get_prgname                   (void);

Gets the name of the program. This name should not be localized, contrast 
with g_get_application_name(). (If you are using GDK or GTK+ the program 
name is set in gdk_init(), which is called by gtk_init(). The program name 
is found by taking the last component of argv[0].)

Returns:	the name of the program. The returned string 
belongs to GLib and must not be modified or freed.

I am able to duplicate the same failure on a system with 

I looks like the test code manipulates argv[0] in the startup code:

    argv = calloc(argc,  sizeof(char*));
    argv[0] = (char*)strdup(""); 
    gtk_init(&argc, &argv);

I'm not really seeing where the "." comes in, nor am I finding a gtk+-2.4 
API reference to see if the behavior was defined differently. Links I do 
find that claim to point to 2.0 end up at the unstable API reference.

Stew Benedict
The Linux Foundation

More information about the lsb-discuss mailing list