Author: mmadia Date: 2010-05-07 21:43:30 +0200 (Fri, 07 May 2010) New Revision: 36732 Changeset: http://dev.haiku-os.org/changeset/36732/haiku Ticket: http://dev.haiku-os.org/ticket/5408 Ticket: http://dev.haiku-os.org/ticket/5927 Modified: haiku/trunk/src/tests/kits/locale/catalogSpeed.cpp haiku/trunk/src/tests/kits/locale/catalogTest.cpp haiku/trunk/src/tests/kits/locale/catalogTestAddOn.cpp Log: Update TR* to B_TRANSLATE. relates to #5408. To note, prior to this changset, this was not building. See #5927 for more information. Modified: haiku/trunk/src/tests/kits/locale/catalogSpeed.cpp =================================================================== --- haiku/trunk/src/tests/kits/locale/catalogSpeed.cpp 2010-05-07 19:37:47 UTC (rev 36731) +++ haiku/trunk/src/tests/kits/locale/catalogSpeed.cpp 2010-05-07 19:43:30 UTC (rev 36732) @@ -95,7 +95,7 @@ watch.Reset(); watch.Resume(); for (uint32 i = 0; i < kNumStrings; i++) { - translated = TR(strs[i].String()); + translated = B_TRANSLATE(strs[i].String()); } watch.Suspend(); printf("\tlooked up %lu strings in %9Ld usecs\n", @@ -161,7 +161,7 @@ watch.Reset(); watch.Resume(); for (uint32 i = 0; i < kNumStrings; i++) { - translated = TR_ID(i); + translated = B_TRANSLATE_ID(i); } watch.Suspend(); printf("\tlooked up %lu strings in %9Ld usecs\n", Modified: haiku/trunk/src/tests/kits/locale/catalogTest.cpp =================================================================== --- haiku/trunk/src/tests/kits/locale/catalogTest.cpp 2010-05-07 19:37:47 UTC (rev 36731) +++ haiku/trunk/src/tests/kits/locale/catalogTest.cpp 2010-05-07 19:43:30 UTC (rev 36732) @@ -124,27 +124,27 @@ assert(res == B_OK); // now check strings: - s = TR_ID(hashVal); + s = B_TRANSLATE_ID(hashVal); assert(s == "Schnur_id"); - s = TR_ALL("string", "programming", ""); + s = B_TRANSLATE_ALL("string", "programming", ""); assert(s == "String"); - s = TR_ALL("string", "programming", "Deutsches Fachbuch"); + s = B_TRANSLATE_ALL("string", "programming", "Deutsches Fachbuch"); assert(s == "Textpuffer"); - s = TR_CMT("string", "Deutsches Fachbuch"); + s = B_TRANSLATE_COMMENT("string", "Deutsches Fachbuch"); assert(s == "Leine"); // the following string should be found in the embedded catalog only: - s = TR_ALL("string", "base", NULL); + s = B_TRANSLATE_ALL("string", "base", NULL); assert(s == "string"); // the following id should be found in the embedded catalog only: - s = TR_ID(32); + s = B_TRANSLATE_ID(32); assert(s == "hashed string"); // the following id doesn't exist anywhere (hopefully): - s = TR_ID(-1); + s = B_TRANSLATE_ID(-1); assert(s == ""); // the following string exists twice, in the embedded as well as in the // external catalog. So we should get the external translation (as it should // override the embedded one): - s = TR("string"); + s = B_TRANSLATE("string"); assert(s == "Schnur"); // now check if trying to access same catalog by specifying its data works: Modified: haiku/trunk/src/tests/kits/locale/catalogTestAddOn.cpp =================================================================== --- haiku/trunk/src/tests/kits/locale/catalogTestAddOn.cpp 2010-05-07 19:37:47 UTC (rev 36731) +++ haiku/trunk/src/tests/kits/locale/catalogTestAddOn.cpp 2010-05-07 19:43:30 UTC (rev 36732) @@ -1,4 +1,4 @@ -/* +/* ** Copyright 2003, Oliver Tappe, zooey@xxxxxxxxxxxxxxxx All rights reserved. ** Distributed under the terms of the OpenBeOS License. */ @@ -22,7 +22,7 @@ #define catName catSig".catalog" -void +void CatalogTestAddOn::Run() { printf("addon..."); status_t res; @@ -86,7 +86,7 @@ } -void +void CatalogTestAddOn::Check() { status_t res; printf("addon-check..."); @@ -95,7 +95,7 @@ size_t hashVal = CatKey::HashFun(s.String()); // ok, we now try to re-load the catalog that has just been written: // - // actually, the following code can be seen as an example of what an + // actually, the following code can be seen as an example of what an // add_on needs in order to translate strings: BCatalog cat; res = get_add_on_catalog(&cat, catSig); @@ -114,27 +114,27 @@ assert(sig == catSig); // now check strings: - s = TR_ID(hashVal); + s = B_TRANSLATE_ID(hashVal); assert(s == "Schnur_id_A"); - s = TR_ALL("string", "programming", ""); + s = B_TRANSLATE_ALL("string", "programming", ""); assert(s == "String_A"); - s = TR_ALL("string", "programming", "Deutsches Fachbuch"); + s = B_TRANSLATE_ALL("string", "programming", "Deutsches Fachbuch"); assert(s == "Textpuffer_A"); - s = TR_CMT("string", "Deutsches Fachbuch"); + s = B_TRANSLATE_COMMENT("string", "Deutsches Fachbuch"); assert(s == "Leine_A"); // the following string should be found in the embedded catalog only: - s = TR_ALL("string", "base", ""); + s = B_TRANSLATE_ALL("string", "base", ""); assert(s == "string_A"); // the following id should be found in the embedded catalog only: - s = TR_ID(32); + s = B_TRANSLATE_ID(32); assert(s == "hashed string_A"); // the following id doesn't exist anywhere (hopefully): - s = TR_ID(-1); + s = B_TRANSLATE_ID(-1); assert(s == ""); - // the following string exists twice, in the embedded as well as in the + // the following string exists twice, in the embedded as well as in the // external catalog. So we should get the external translation (as it should // override the embedded one): - s = TR("string"); + s = B_TRANSLATE("string"); assert(s == "Schnur_A"); // check access to app-catalog from inside add-on: