Now the Sambhota keyboard crashing bug.

Fixed crashing bug reported by Teresa Lam.  Added tests so that I'm fairly
certain that no more crashing bugs exist.  Removed a marker for iffy code
after understanding that code via test cases.
This commit is contained in:
dchandler 2004-07-05 04:46:39 +00:00
parent e101cc8294
commit 11c3898ad2

View file

@ -117,6 +117,7 @@ public class DuffPaneTest extends TestCase {
happened -- see the errata for the Tibetan! 5.1 docs), this happened -- see the errata for the Tibetan! 5.1 docs), this
will catch it. */ will catch it. */
public void testTibwnIni() { public void testTibwnIni() {
enableEWTSKeyboard();
/* <?Input:Tibetan?>: */ /* <?Input:Tibetan?>: */
e("ka"); e("k", "ka"); e("ki"); e("ku"); e("ke"); e("ko"); e("kU"); e("kM"); e("kau"); e("kai"); e("kI"); e("k-i"); e("ka"); e("k", "ka"); e("ki"); e("ku"); e("ke"); e("ko"); e("kU"); e("kM"); e("kau"); e("kai"); e("kI"); e("k-i");
e("kha"); e("kh", "kha"); e("khi"); e("khu"); e("khe"); e("kho"); e("khU"); e("khM"); e("khau"); e("khai"); e("khI"); e("kh-i"); e("kha"); e("kh", "kha"); e("khi"); e("khu"); e("khe"); e("kho"); e("khU"); e("khM"); e("khau"); e("khai"); e("khI"); e("kh-i");
@ -811,6 +812,7 @@ public class DuffPaneTest extends TestCase {
} }
public void testNoKeysCrashUs() { public void testNoKeysCrashUs() {
enableEWTSKeyboard();
/* why 130? because we want to try some extended ASCII /* why 130? because we want to try some extended ASCII
characters to make sure that they don't crash us either */ characters to make sure that they don't crash us either */
char max = (char)130; char max = (char)130;
@ -820,9 +822,18 @@ public class DuffPaneTest extends TestCase {
noExceptions("" + ch + ch2); noExceptions("" + ch + ch2);
} }
} }
// FIXME: test the sambhota and TCC keyboards
enableSambhotaKeyboard();
for (char ch = 0; ch < max; ch++) {
noExceptions("" + ch);
for (char ch2 = 0; ch2 < max; ch2++) {
noExceptions("" + ch + ch2);
}
}
} }
public void testDisambiguation() { public void testDisambiguation() {
enableEWTSKeyboard();
ensureKeysGiveCorrectWylie("gya"); ensureKeysGiveCorrectWylie("gya");
ensureKeysGiveCorrectWylie("g.ya"); ensureKeysGiveCorrectWylie("g.ya");
ensureKeysGiveCorrectWylie("bya"); ensureKeysGiveCorrectWylie("bya");
@ -854,6 +865,7 @@ public class DuffPaneTest extends TestCase {
* keyboard, turning those into our internal representation (IR), * keyboard, turning those into our internal representation (IR),
* and then converting the result to Extended Wylie. */ * and then converting the result to Extended Wylie. */
public void testWylieToIRToWylie() { public void testWylieToIRToWylie() {
enableEWTSKeyboard();
// FIXME: test achen when it's not alone -- once Jskad's // FIXME: test achen when it's not alone -- once Jskad's
// keyboard supports that! Right now, you have to type "d // keyboard supports that! Right now, you have to type "d
// a<LEFTARROW><BACKSPACE><RIGHTARROW> " to get EWTS {d.a }. // a<LEFTARROW><BACKSPACE><RIGHTARROW> " to get EWTS {d.a }.
@ -1135,12 +1147,24 @@ public class DuffPaneTest extends TestCase {
} }
} }
private void enableEWTSKeyboard() {
new JskadKeyboard("EWTS for DuffPaneTest",
null,
null).activate(dp);
}
private void enableACIPKeyboard() { private void enableACIPKeyboard() {
new JskadKeyboard("Asian Classics Input Project (ACIP) FOR DuffPaneTest", new JskadKeyboard("Asian Classics Input Project (ACIP) FOR DuffPaneTest",
"acip_keyboard.ini", "acip_keyboard.ini",
null).activate(dp); null).activate(dp);
} }
private void enableSambhotaKeyboard() {
new JskadKeyboard("Sambhota Keymap One FOR DuffPaneTest",
"sambhota_keyboard_1.ini",
null).activate(dp);
}
/** Tests performing a few keystrokes in the ACIP keyboard, /** Tests performing a few keystrokes in the ACIP keyboard,
* turning those into our internal representation (IR), and then * turning those into our internal representation (IR), and then
* converting the result to Extended Wylie. These test cases are * converting the result to Extended Wylie. These test cases are