summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2002-09-05 20:44:36 +0000
committerMatthias Melcher <fltk@matthiasm.com>2002-09-05 20:44:36 +0000
commit6698be1be81a2c98707b4842022f1075e9b082a0 (patch)
treecb93b0d56124169d294dbb64ea2ff1b893fb4923 /test
parent32b9640e1ca9ce14f802309ad7818c23910dc62c (diff)
Mac OS X: modified Fl_Preferences::Node::search to correctly handle groups
inside the root group and to allow for relative and absolute path names. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2619 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test')
-rw-r--r--test/preferences.fl25
1 files changed, 22 insertions, 3 deletions
diff --git a/test/preferences.fl b/test/preferences.fl
index 443684c2c..06f6b25c1 100644
--- a/test/preferences.fl
+++ b/test/preferences.fl
@@ -12,6 +12,8 @@ decl {\#include <stdlib.h>} {}
decl {\#include <FL/filename.H>} {}
+decl {\#include <FL/fl_ask.H>} {}
+
decl {void readPrefs();} {public
}
@@ -294,9 +296,26 @@ Function {writePrefs()} {open return_type void
eat.set( Fl_Preferences::Name( 3 ), "Test3" );
- /** sample code only:
+ /* sample: create a sub-sub-group */
+ Fl_Preferences eatMore( eat, "More" );
+
+ eatMore.set( "more", "stuff" );
+
+ /* all the following searches should return 1 */
+ int sum = 0;
+ sum += app.groupExists( "Breakfast" ); /* find 'eat' relative to 'app' */
+ sum += app.groupExists( "Breakfast/More" ); /* find 'eat.eatMore' relative to 'app' */
+ sum += app.groupExists( "./Breakfast/More" ); /* find 'eat.eatMore' relative to Preferences */
+ sum += eat.groupExists( "More" ); /* find 'eatMore' relative to 'eat' */
+ sum += eat.groupExists( "./Breakfast/More" ); /* find 'eat.eatMore' relative to Preferences */
+ sum += eat.groupExists( "." ); /* find myself ('eat') */
+ sum += eat.groupExists( "./" ); /* find the topmost group ('app') */
+ if ( sum != 7 )
+ fl_message( "Assertion failed:\\nNot all group entries were found!" );
+
+ /* sample code only: */
unsigned int hex = 0x2387efcd;
eat.set( "binFoo", (void*)&hex, sizeof( unsigned int ) );
- eat.set( "binFoo2", (void*)&writePrefs, 1024 );
- **/} {}
+ eat.set( "binFoo2", (void*)&writePrefs, 256 );
+ } {}
}