1210 switch (count) |
1201 switch (count) |
1211 { |
1202 { |
1212 case 5: |
1203 case 5: |
1213 line1 = &(aDevice->LineArray().Line(4)); |
1204 line1 = &(aDevice->LineArray().Line(4)); |
1214 line2 = aDevice->LineArray().Find(KTestStrings[aIndex][aNumChar][5]); |
1205 line2 = aDevice->LineArray().Find(KTestStrings[aIndex][aNumChar][5]); |
1215 TESTPOINT(0 != line1); |
1206 test(0 != line1); |
1216 TESTPOINT(0 != line2); |
1207 test(0 != line2); |
1217 TESTPOINT(line1->iLineData.Compare(line2->iLineData) == 0); |
1208 test(line1->iLineData.Compare(line2->iLineData) == 0); |
1218 case 4: |
1209 case 4: |
1219 line1 = &(aDevice->LineArray().Line(3)); |
1210 line1 = &(aDevice->LineArray().Line(3)); |
1220 line2 = aDevice->LineArray().Find(KTestStrings[aIndex][aNumChar][4]); |
1211 line2 = aDevice->LineArray().Find(KTestStrings[aIndex][aNumChar][4]); |
1221 TESTPOINT(0 != line1); |
1212 test(0 != line1); |
1222 TESTPOINT(0 != line2); |
1213 test(0 != line2); |
1223 TESTPOINT(line1->iLineData.Compare(line2->iLineData) == 0); |
1214 test(line1->iLineData.Compare(line2->iLineData) == 0); |
1224 case 3: |
1215 case 3: |
1225 line1 = &(aDevice->LineArray().Line(2)); |
1216 line1 = &(aDevice->LineArray().Line(2)); |
1226 line2 = aDevice->LineArray().Find(KTestStrings[aIndex][aNumChar][3]); |
1217 line2 = aDevice->LineArray().Find(KTestStrings[aIndex][aNumChar][3]); |
1227 TESTPOINT(0 != line1); |
1218 test(0 != line1); |
1228 TESTPOINT(0 != line2); |
1219 test(0 != line2); |
1229 TESTPOINT(line1->iLineData.Compare(line2->iLineData) == 0); |
1220 test(line1->iLineData.Compare(line2->iLineData) == 0); |
1230 case 2: |
1221 case 2: |
1231 line1 = &(aDevice->LineArray().Line(1)); |
1222 line1 = &(aDevice->LineArray().Line(1)); |
1232 line2 = aDevice->LineArray().Find(KTestStrings[aIndex][aNumChar][2]); |
1223 line2 = aDevice->LineArray().Find(KTestStrings[aIndex][aNumChar][2]); |
1233 TESTPOINT(0 != line1); |
1224 test(0 != line1); |
1234 TESTPOINT(0 != line2); |
1225 test(0 != line2); |
1235 TESTPOINT(line1->iLineData.Compare(line2->iLineData) == 0); |
1226 test(line1->iLineData.Compare(line2->iLineData) == 0); |
1236 case 1: |
1227 case 1: |
1237 line1 = &(aDevice->LineArray().Line(0)); |
1228 line1 = &(aDevice->LineArray().Line(0)); |
1238 line2 = aDevice->LineArray().Find(KTestStrings[aIndex][aNumChar][1]); |
1229 line2 = aDevice->LineArray().Find(KTestStrings[aIndex][aNumChar][1]); |
1239 TESTPOINT(0 != line1); |
1230 test(0 != line1); |
1240 TESTPOINT(0 != line2); |
1231 test(0 != line2); |
1241 // Can't always do a direct comparison of lines because same string |
1232 // Can't always do a direct comparison of lines because same string |
1242 // may appear in more than one line, so compare contents |
1233 // may appear in more than one line, so compare contents |
1243 TESTPOINT(line1->iLineData.Compare(line2->iLineData) == 0); |
1234 test(line1->iLineData.Compare(line2->iLineData) == 0); |
1244 } |
1235 } |
1245 aLayout->SetInterfaceProvider(NULL); |
1236 aLayout->SetInterfaceProvider(NULL); |
1246 CleanupStack::PopAndDestroy(interfaceProvider); |
1237 CleanupStack::PopAndDestroy(interfaceProvider); |
1247 } |
1238 } |
1248 |
1239 |
1249 void GeneralCombinationTestsTextViewL(TDes& aText, CTextLayout* aLayout, CTestGraphicsDevice* aDevice, CTextView* aView, TInt aNumChar) |
1240 void GeneralCombinationTestsTextViewL(TDes& aText, CTextLayout* aLayout, CTestGraphicsDevice* aDevice, CTextView* aView, TInt aNumChar) |
1250 { |
1241 { |
1251 // For all tests carried out from here up to 20 chars will fit on a line |
1242 // For all tests carried out from here up to 20 chars will fit on a line |
1252 TESTPRINT(_L("Test L-P")); |
1243 test.Start(_L("Test L-P")); |
1253 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 0); |
1244 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 0); |
1254 TESTPRINT(_L("Test X L-P")); |
1245 test.Next(_L("Test X L-P")); |
1255 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 1); |
1246 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 1); |
1256 TESTPRINT(_L("Test P-T")); |
1247 test.Next(_L("Test P-T")); |
1257 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 2); |
1248 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 2); |
1258 TESTPRINT(_L("Test P-T Y")); |
1249 test.Next(_L("Test P-T Y")); |
1259 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 3); |
1250 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 3); |
1260 TESTPRINT(_L("Test L-P-T")); |
1251 test.Next(_L("Test L-P-T")); |
1261 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 4); |
1252 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 4); |
1262 TESTPRINT(_L("Test L-C-T")); |
1253 test.Next(_L("Test L-C-T")); |
1263 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 5); |
1254 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 5); |
1264 TESTPRINT(_L("Test X L-P-T")); |
1255 test.Next(_L("Test X L-P-T")); |
1265 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 6); |
1256 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 6); |
1266 TESTPRINT(_L("Test X L-C-T")); |
1257 test.Next(_L("Test X L-C-T")); |
1267 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 7); |
1258 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 7); |
1268 TESTPRINT(_L("Test L-P-T Y")); |
1259 test.Next(_L("Test L-P-T Y")); |
1269 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 8); |
1260 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 8); |
1270 TESTPRINT(_L("Test L-C-T Y")); |
1261 test.Next(_L("Test L-C-T Y")); |
1271 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 9); |
1262 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 9); |
1272 TESTPRINT(_L("Test X L-P-T Y")); |
1263 test.Next(_L("Test X L-P-T Y")); |
1273 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 10); |
1264 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 10); |
1274 TESTPRINT(_L("Test X L-C-T Y")); |
1265 test.Next(_L("Test X L-C-T Y")); |
1275 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 11); |
1266 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 11); |
|
1267 test.End(); |
1276 } |
1268 } |
1277 |
1269 |
1278 void SpecificTestsTextViewL(TDes& aText, CTextLayout* aLayout, CTestGraphicsDevice* aDevice, CTextView* aView, TInt aNumChar) |
1270 void SpecificTestsTextViewL(TDes& aText, CTextLayout* aLayout, CTestGraphicsDevice* aDevice, CTextView* aView, TInt aNumChar) |
1279 { |
1271 { |
1280 // For all tests carried out from here up to 10 chars will fit on a line |
1272 // For all tests carried out from here up to 10 chars will fit on a line |
1281 TESTPRINT(_L("Test P-T B")); |
1273 test.Start(_L("Test P-T B")); |
1282 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 12); |
1274 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 12); |
1283 TESTPRINT(_L("Test X P-T one")); |
1275 test.Next(_L("Test X P-T one")); |
1284 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 13); |
1276 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 13); |
1285 TESTPRINT(_L("Test X P-T two")); |
1277 test.Next(_L("Test X P-T two")); |
1286 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 14); |
1278 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 14); |
1287 TESTPRINT(_L("Test X L-P-T one")); |
1279 test.Next(_L("Test X L-P-T one")); |
1288 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 15); |
1280 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 15); |
1289 TESTPRINT(_L("Test X L-P-T two")); |
1281 test.Next(_L("Test X L-P-T two")); |
1290 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 16); |
1282 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 16); |
1291 TESTPRINT(_L("Test X L-P-T three")); |
1283 test.Next(_L("Test X L-P-T three")); |
1292 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 17); |
1284 DoLineTestL(aText, aLayout, aDevice, aView, aNumChar, 17); |
|
1285 test.End(); |
1293 } |
1286 } |
1294 |
1287 |
1295 void DoLineTestForINC141914L(TDes& aText, CTextLayout* aLayout, CTestGraphicsDevice* aDevice, CTextView* aView) |
1288 void DoLineTestForINC141914L(TDes& aText, CTextLayout* aLayout, CTestGraphicsDevice* aDevice, CTextView* aView) |
1296 { |
1289 { |
1297 /* |
1290 /* |
1450 CleanupStack::PopAndDestroy(layout); |
1443 CleanupStack::PopAndDestroy(layout); |
1451 CleanupStack::PopAndDestroy(scheduler); |
1444 CleanupStack::PopAndDestroy(scheduler); |
1452 __UHEAP_MARKEND; |
1445 __UHEAP_MARKEND; |
1453 } |
1446 } |
1454 |
1447 |
1455 TVerdict CTInLineTextStep::doTestStepL() |
1448 TInt E32Main() |
1456 { |
1449 { |
1457 SetTestStepResult(EPass); |
|
1458 TestStep = this; |
|
1459 |
|
1460 __UHEAP_MARK; |
1450 __UHEAP_MARK; |
1461 TESTPRINT(KTInlineText); |
1451 test.Title(); |
1462 TESTPRINT(_L(" @SYMTestCaseID:SYSLIB-FORM-LEGACY-INLINETEXT-0001 General combination tests - no inline text ")); |
1452 static CTrapCleanup* TrapCleanup = CTrapCleanup::New(); |
|
1453 test.Start(_L(" @SYMTestCaseID:SYSLIB-FORM-LEGACY-INLINETEXT-0001 General combination tests - no inline text ")); |
1463 TInt error = RFbsSession::Connect(); |
1454 TInt error = RFbsSession::Connect(); |
1464 if (error == KErrNotFound) |
1455 if (error == KErrNotFound) |
1465 { |
1456 { |
1466 FbsStartup(); |
1457 FbsStartup(); |
1467 error = RFbsSession::Connect(); |
1458 error = RFbsSession::Connect(); |
1468 } |
1459 } |
1469 TEST(error == KErrNone); |
1460 test(error == KErrNone); |
1470 TRAP(error, RunGeneralCombinationTestsL(0)); |
1461 TRAP(error, RunGeneralCombinationTestsL(0)); |
1471 TEST(error == KErrNone); |
1462 test(error == KErrNone); |
1472 TESTPRINT(_L("General combination tests - single char inline text")); |
1463 test.Next(_L("General combination tests - single char inline text")); |
1473 TRAP(error, RunGeneralCombinationTestsL(1)); |
1464 TRAP(error, RunGeneralCombinationTestsL(1)); |
1474 TEST(error == KErrNone); |
1465 test(error == KErrNone); |
1475 TESTPRINT(_L("General combination tests - multi char inline text")); |
1466 test.Next(_L("General combination tests - multi char inline text")); |
1476 TRAP(error, RunGeneralCombinationTestsL(2)); |
1467 TRAP(error, RunGeneralCombinationTestsL(2)); |
1477 TEST(error == KErrNone); |
1468 test(error == KErrNone); |
1478 TESTPRINT(_L("Specific tests - no inline text")); |
1469 test.Next(_L("Specific tests - no inline text")); |
1479 TRAP(error, RunSpecificTestsL(0)); |
1470 TRAP(error, RunSpecificTestsL(0)); |
1480 TEST(error == KErrNone); |
1471 test(error == KErrNone); |
1481 TESTPRINT(_L("Specific tests - single char inline text")); |
1472 test.Next(_L("Specific tests - single char inline text")); |
1482 TRAP(error, RunSpecificTestsL(1)); |
1473 TRAP(error, RunSpecificTestsL(1)); |
1483 TEST(error == KErrNone); |
1474 test(error == KErrNone); |
1484 TESTPRINT(_L("Specific tests - multi char inline text")); |
1475 test.Next(_L("Specific tests - multi char inline text")); |
1485 TRAP(error, RunSpecificTestsL(2)); |
1476 TRAP(error, RunSpecificTestsL(2)); |
1486 TEST(error == KErrNone); |
1477 test(error == KErrNone); |
1487 |
1478 |
1488 TESTPRINT(_L("Defect tests - for INC141914")); |
1479 test.Next(_L("Defect tests - for INC141914")); |
1489 TRAP(error, RunTestsForINC141914L()); |
1480 TRAP(error, RunTestsForINC141914L()); |
1490 TEST(error == KErrNone); |
1481 test(error == KErrNone); |
1491 |
1482 |
1492 RFbsSession::Disconnect(); |
1483 RFbsSession::Disconnect(); |
|
1484 test.End(); |
|
1485 delete TrapCleanup; |
|
1486 test.Close(); |
1493 __UHEAP_MARKEND; |
1487 __UHEAP_MARKEND; |
1494 User::Heap().Check(); |
1488 User::Heap().Check(); |
1495 return TestStepResult(); |
1489 return error; |
1496 } |
1490 } |