op_lid: handle spurious 'open' calls
[pandora-libraries.git] / test / discotest.c
index 5bc7030..f6584b0 100644 (file)
@@ -8,7 +8,9 @@
 #include "pnd_apps.h"
 #include "pnd_pxml.h"
 #include "pnd_discovery.h"
+#include "pnd_desktop.h"
 #include "pnd_locate.h"
+#include "pnd_utility.h"
 
 int main ( int argc, char *argv[] ) {
   char *configpath;
@@ -123,7 +125,10 @@ int main ( int argc, char *argv[] ) {
       printf ( "  Base path: %s filename: %s\n", d -> object_path, d -> object_filename );
 
       if ( d -> title_en ) {
-       printf ( "  Name: %s\n", d -> title_en );
+       printf ( "  Name EN: %s\n", d -> title_en );
+      }
+      if ( d -> desc_en ) {
+       printf ( "  Desc EN: %s\n", d -> desc_en );
       }
       if ( d -> icon ) {
        printf ( "  Icon: %s\n", d -> icon );
@@ -146,6 +151,15 @@ int main ( int argc, char *argv[] ) {
       if ( d -> clockspeed ) {
        printf ( "  Clockspeed: %s\n", d -> clockspeed );
       }
+      if ( d -> preview_pic1 ) {
+       printf ( "  Preview Pic 1: %s\n", d -> preview_pic1 );
+      }
+      if ( d -> preview_pic2 ) {
+       printf ( "  Preview Pic 2: %s\n", d -> preview_pic2 );
+      }
+      if ( d -> mkdir_sp ) {
+       printf ( "  mkdir requests: %s\n", d -> mkdir_sp );
+      }
 
       if ( do_icon ) {
        if ( pnd_emit_icon ( "./testdata/dotdesktop", d ) ) {
@@ -198,8 +212,19 @@ int main ( int argc, char *argv[] ) {
          } else if ( d -> object_type == pnd_object_type_pnd ) {
            sprintf ( fullpath, "%s/%s", d -> object_path, d -> object_filename );
          }
+
+         printf ( "Guessing appdata path..\n" );
+         char appdata_path [ 1024 ];
+         pnd_get_ro_mountpoint ( fullpath, d -> unique_id, appdata_path, 1024 );
+         printf ( "Guessed readonly app mountpoint '%s'\n", appdata_path );
+         if ( pnd_get_appdata_path ( fullpath, d -> unique_id, appdata_path, 1024 ) ) {
+           printf ( "  Appdata should be: %s\n", appdata_path );
+         } else {
+           printf ( "  Error determining appdata path..\n" );
+         }
+
          printf ( "Trying to exec '%s'\n", fullpath );
-         pnd_apps_exec ( pndrun, fullpath, d -> unique_id, d -> exec, d -> startdir, atoi ( d -> clockspeed ), PND_EXEC_OPTION_BLOCK );
+         pnd_apps_exec ( pndrun, fullpath, d -> unique_id, d -> exec, d -> startdir, NULL, atoi ( d -> clockspeed ), PND_EXEC_OPTION_BLOCK );
        }
       }
 
@@ -213,5 +238,11 @@ int main ( int argc, char *argv[] ) {
     pnd_box_delete ( apph );
   }
 
+  // extra testing - tilde-substitution
+  printf ( "Unrelated test..\n" );
+  char *p = strdup ( "~/.applications" );
+  printf ( "Tilde substitution: in '%s'\n", p );
+  printf ( "                   out '%s'\n", pnd_expand_tilde ( p ) );
+
   return ( 0 );
 }