add: BFile testOut("/tmp/stxt_tran_dmallio.out", B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE); proster->Translate(&mallio, NULL, NULL, &testOut, B_TRANSLATOR_TEXT); debugger("foo");
context: TranslateTests(STXTTranslatorTest *ptest, BTranslatorRoster *proster,	const char **paths, int32 len, bool bplain){	int32 nlongest = 0, ncurrent = 0;	// find the length of the longest string	for (int32 i = 0; i < len; i++) {		ncurrent = strlen(paths[i]);		if (ncurrent > nlongest)			nlongest = ncurrent;	}		char *styled_path = NULL, *plain_path = NULL;	styled_path = new char[nlongest + 6];	plain_path = new char[nlongest + 6];		// Perform translations on every file in the array	for (int32 i = 0; i < len; i++) {		strcpy(styled_path, paths[i]);		strcat(styled_path, ".stxt");		strcpy(plain_path, paths[i]);		strcat(plain_path, ".txt");				// Setup input files			ptest->NextSubTest();		BFile styled_file, plain_file, *pinput_file;		CPPUNIT_ASSERT(styled_file.SetTo(styled_path, B_READ_ONLY) == B_OK);		CPPUNIT_ASSERT(plain_file.SetTo(plain_path, B_READ_ONLY) == B_OK);		if (bplain) {			printf(" [%s] ", plain_path);			pinput_file = &plain_file;		} else {			printf(" [%s] ", styled_path);			pinput_file = &styled_file;		}				BMallocIO mallio, dmallio;				// Convert to B_TRANSLATOR_ANY_TYPE (should be B_TRANSLATOR_TEXT)		ptest->NextSubTest();		CPPUNIT_ASSERT(mallio.Seek(0, SEEK_SET) == 0);		CPPUNIT_ASSERT(mallio.SetSize(0) == B_OK);		CPPUNIT_ASSERT(proster->Translate(pinput_file, NULL, NULL, &mallio,			B_TRANSLATOR_ANY_TYPE) == B_OK);		CPPUNIT_ASSERT(CompareStreams(mallio, plain_file) == true);				// Convert to B_TRANSLATOR_TEXT		ptest->NextSubTest();		CPPUNIT_ASSERT(mallio.Seek(0, SEEK_SET) == 0);		CPPUNIT_ASSERT(mallio.SetSize(0) == B_OK);		CPPUNIT_ASSERT(proster->Translate(pinput_file, NULL, NULL, &mallio,			B_TRANSLATOR_TEXT) == B_OK);		CPPUNIT_ASSERT(CompareStreams(mallio, plain_file) == true);				// Convert plain mallio to B_TRANSLATOR_TEXT dmallio		ptest->NextSubTest();		CPPUNIT_ASSERT(dmallio.Seek(0, SEEK_SET) == 0);		CPPUNIT_ASSERT(dmallio.SetSize(0) == B_OK);		CPPUNIT_ASSERT(proster->Translate(&mallio, NULL, NULL, &dmallio,			B_TRANSLATOR_TEXT) == B_OK);		CPPUNIT_ASSERT(CompareStreams(dmallio, plain_file) == true);				// Convert to B_STYLED_TEXT_FORMAT		ptest->NextSubTest();		CPPUNIT_ASSERT(mallio.Seek(0, SEEK_SET) == 0);		CPPUNIT_ASSERT(mallio.SetSize(0) == B_OK);		CPPUNIT_ASSERT(proster->Translate(pinput_file, NULL, NULL, &mallio,			B_STYLED_TEXT_FORMAT) == B_OK);		CPPUNIT_ASSERT(CompareStreams(mallio, styled_file) == true);				// Convert styled mallio to B_TRANSLATOR_TEXT dmallio		ptest->NextSubTest();		CPPUNIT_ASSERT(dmallio.Seek(0, SEEK_SET) == 0);		CPPUNIT_ASSERT(dmallio.SetSize(0) == B_OK);		CPPUNIT_ASSERT(proster->Translate(&mallio, NULL, NULL, &dmallio,			B_TRANSLATOR_TEXT) == B_OK);		CPPUNIT_ASSERT(CompareStreams(dmallio, plain_file) == true);				// Convert styled mallio to B_STYLED_TEXT_FORMAT dmallio		ptest->NextSubTest();		CPPUNIT_ASSERT(dmallio.Seek(0, SEEK_SET) == 0);		CPPUNIT_ASSERT(dmallio.SetSize(0) == B_OK);		CPPUNIT_ASSERT(proster->Translate(&mallio, NULL, NULL, &dmallio,			B_STYLED_TEXT_FORMAT) == B_OK);		CPPUNIT_ASSERT(CompareStreams(dmallio, styled_file) == true);	}		delete[] styled_path;	styled_path = NULL;	delete[] plain_path;	plain_path = NULL;}