Go to the FreeLists Home Page Home Signup Help Login
 



[openbeostranslationkit] || [Date Prev] [04-2002 Date Index] [Date Next] || [Thread Prev] [04-2002 Thread Index] [Thread Next]

[openbeostranslationkit] Re: BTranslationRoster woes

  • From: Mike Wilber <wilber@xxxxxxxxxxxxxxxx>
  • To: openbeostranslationkit@xxxxxxxxxxxxx
  • Date: Mon, 1 Apr 2002 18:07:31 -0500 (EST)
On Mon, 1 Apr 2002, Brian Matzon wrote:

|I'm having some problems with my BTranslatorRoster test. Does anybody
|have a clue to the following:
|
|1)
|virtual status_t AddTranslators(const char *load_path = NULL)
|this method may return B_BAD_VALUE if the supplied path is invalid.
|I have tried all sorts of strange paths to make it return that value,
|but have been unable to make it
|return B_BAD_VALUE (even '?' doesn't work...)

Maybe they mean may, as in, never.

|
|2)
|BTranslatorRoster *Instantiate(BMessage *from)
|This is the archivable method, wich returns a BTranslatorRoster from a
|BMessage.
|The docs state:
|"Returns a new BTranslatorRoster object, allocated by new and created
|with the version of the constructor that takes a BMessage archive."
|The following works:
|  BMessage translator_message;
|  translator_message.AddString("be:translator_path", "/boot/home/config
|/add-ons/Translators");
|  translator_roster = new BTranslatorRoster(&translator_message);
|However this doesn't work:
|  BMessage translator_message;
|  translator_message.AddString("be:translator_path", "/boot/home/config
|/add-ons/Translators/");
|  translator_roster = (BTranslatorRoster*)
|BTranslatorRoster::Instantiate(&translator_message);
|Why Why Why ???

I believe that the BMessage constructor and the Instantiate function are
for two separate things. It seems strange to me that they would have two
different functions for doing the same thing. I believe the Instantiate
function is for creating BTranslatorRosters that were archived with the
Archive member function, and the BMessage constructor works as you've used
it.  I would try using the Archive member function with a working
BTranslatorRoster, then try to create a new BTranslatorRoster using
Instantiate with the BMessage that the Archive member function created.

|3)
|The current (BTranslatorRoster) test is encapsulated in a
|TranslatorRosterTest object, which
|has a method called <method_to_test>Test. It hasn't yet been converted
|to the Unit framework
|(nor have my other tests). So my tests are all text based, and so will
|the unit tests be.
|How do I then test the:
|  virtual status_t MakeConfigurationView(translator_id forTranslator,
|BMessage *ioExtension, BView **outView, BRect *outExtent)
|?
|I cannot even create a BView since I am not a BApplication...
|Or for that matter - how do I test visual stuff (ie. non measurable
|stuff)?

I would imagine that you would have to create a GUI app, passing the BView
that you get from MakeConfigurationView to a BWindow. You could probably
start with the HelloWord example and modify it a bit.

|
|Hope someone can help...
|/Brian Matzon
|






[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.