예제 #1
0
int main() 
{ 
	TestPart1();
	TestPart2();
	TestPart3();
	return 0;
}
예제 #2
0
TEST(NormalizationTest, Main) {
  if (sizeof(wchar_t) != 2) {
    printf("This test can only be run where sizeof(wchar_t) == 2\n");
    return;
  }
  if (strlen(versionText) == 0) {
    printf("No testcases: to run the tests generate the header file using\n");
    printf(" perl genNormalizationData.pl\n");
    printf("in intl/unichar/tools and rebuild\n");
    return;
  }

  printf("NormalizationTest: test nsIUnicodeNormalizer. UCD version: %s\n", 
         versionText); 

  normalizer = nullptr;
  nsresult res;
  res = CallGetService(kUnicodeNormalizerCID, &normalizer);
  
  ASSERT_FALSE(NS_FAILED(res)) << "GetService failed";
  ASSERT_NE(nullptr, normalizer);

  TestPart0();
  TestPart1();
  TestPart2();
  TestPart3();
  
  NS_RELEASE(normalizer);
}
예제 #3
0
int main(int argc, char** argv) {
  if (sizeof(wchar_t) != 2) {
    printf("This test can only be run where sizeof(wchar_t) == 2\n");
    return 1;
  }
  if (strlen(versionText) == 0) {
    printf("No testcases: to run the tests generate the header file using\n");
    printf(" perl genNormalizationData.pl\n");
    printf("in intl/unichar/tools and rebuild\n");
    return 1;
  }

  printf("NormalizationTest: test nsIUnicodeNormalizer. UCD version: %s\n", 
         versionText); 
  if (argc <= 1)
    verboseMode = false;
  else if ((argc == 2) && (!strcmp(argv[1], "-v")))
    verboseMode = true;
  else {
    printf("                   Usage: NormalizationTest [OPTION]..\n");
    printf("Options:\n");
    printf("        -v   Verbose mode\n");
    return 1;
  }

  nsresult rv = NS_InitXPCOM2(nullptr, nullptr, nullptr);
  if (NS_FAILED(rv)) {
    printf("NS_InitXPCOM2 failed\n");
    return 1;
  }
  
  normalizer = nullptr;
  nsresult res;
  res = CallGetService(kUnicodeNormalizerCID, &normalizer);
  
 if(NS_FAILED(res) || !normalizer) {
    printf("GetService failed\n");
    return 1;
  }

  TestPart0();
  TestPart1();
  TestPart2();
  TestPart3();
  
  NS_RELEASE(normalizer);

  printf("Test finished \n");
  return 0;
}