From 6698be1be81a2c98707b4842022f1075e9b082a0 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 5 Sep 2002 20:44:36 +0000 Subject: 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 --- test/preferences.fl | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'test') 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 } {} decl {\#include } {} +decl {\#include } {} + 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 ); + } {} } -- cgit v1.2.3