
|
[openbeostranslationkit]
||
[Date Prev]
[04-2002 Date Index]
[Date Next]
||
[Thread Prev]
[04-2002 Thread Index]
[Thread Next]
[openbeostranslationkit] BTranslationRoster woes
- From: "Brian Matzon" <brian@xxxxxxxxx>
- To: openbeostranslationkit@xxxxxxxxxxxxx
- Date: Mon, 1 Apr 2002 22:17:54 +0200
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...)
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 ???
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)?
4)
When translating from tga to bmp why does the following not work?
BFile input("./data/images/image.tga", B_READ_ONLY);
BFile output("./data/images/image.out.bmp", B_WRITE_ONLY |
B_CREATE_FILE | B_ERASE_FILE);
roster->Translate(&input, NULL, NULL, &output, B_BMP_FORMAT);
I always get a B_NO_TRANSLATOR status_t back... *ponder*
Hope someone can help...
/Brian Matzon
|

|