return 0;
return tests_failed;
main()  {	    int tests_failed = 0;  	cout << "String unit tests.  Compiled " __DATE__ " " __TIME__ << endl;#if 0    {      nsFragmentedCString fs0;      fs0.Append("Hello");      tests_failed += test_readable_hello(fs0);      tests_failed += test_writable(fs0);    }#endif    {      NS_NAMED_LITERAL_STRING(literal, "Hello");      PRUnichar* buffer = ToNewUnicode(literal);      nsSlidingString ss0(buffer, buffer+5, buffer+6);//    ss0.AppendBuffer(buffer, buffer+5, buffer+6);      nsReadingIterator<PRUnichar> ri0;      ss0.BeginReading(ri0);      tests_failed += test_readable_hello(ss0);      nsSlidingSubstring ss1(ss0);      tests_failed += test_readable_hello(ss1);      buffer = ToNewUnicode(literal);      ss0.AppendBuffer(buffer, buffer+5, buffer+6);      ri0.advance(5);      ss0.DiscardPrefix(ri0);      tests_failed += test_readable_hello(ss0);      tests_failed += test_readable_hello(ss1);      nsReadingIterator<PRUnichar> ri1;      ss0.EndReading(ri1);      nsSlidingSubstring ss2(ss0, ri0, ri1);      tests_failed += test_readable_hello(ss2);    }    {      nsLiteralCString s0("Patrick Beard made me write this: \"This is just a test\"\n");      print_string(s0);      const char* raw_string = "He also made me write this.\n";      nsFileCharSink<char> output(stdout);      copy_string(raw_string, raw_string+nsCharTraits<char>::length(raw_string), output);      nsLiteralCString s1("This ", 5), s2("is ", 3), s3("a ", 2), s4("test\n", 5);      print_string(s1+s2+s3+s4);      nsLiteralCString s5( "This is " "a " "test" );      print_string(s5+NS_LITERAL_CSTRING("\n"));      print_string(nsLiteralCString("The value of the string |x| is \"") + Substring(s0, 0, s0.Length()-1) + NS_LITERAL_CSTRING("\".  Hope you liked it."));    }    {      tests_failed += test_readable_hello(NS_LITERAL_STRING("Hello"));      nsLiteralCString s1("Hello");      tests_failed += test_readable_hello(s1);    }    {      nsString s3( NS_LITERAL_STRING("Hello") );      tests_failed += test_readable_hello(s3);      tests_failed += test_writable(s3);      nsCString s4("Hello");      tests_failed += test_readable_hello(s4);      tests_failed += test_writable(s4);    }    {      nsStdString s5( NS_LITERAL_STRING("Hello") );      tests_failed += test_readable_hello(s5);      tests_failed += test_writable(s5);      nsStdCString s6("Hello");      tests_failed += test_readable_hello(s6);      tests_failed += test_writable(s6);    }    {      nsLiteralString s7(NS_LITERAL_STRING("He"));      nsString        s8(NS_LITERAL_STRING("l"));      nsStdString     s9(NS_LITERAL_STRING("lo"));      tests_failed += test_readable_hello(s7+s8+s9);      nsString s13( s7 + s8 + s9 );      tests_failed += test_readable_hello(s13);      nsStdString s14( s7 + s8 + s9 );      tests_failed += test_readable_hello(s14);      nsSharedString* s15 = new_nsSharedString( s7 + s8 + s9 );      tests_failed += test_readable_hello(*s15);      // cout << "Here's a string: \""; print_string(*s15) << "\"" << endl;      nsCString         s10("He");      nsLiteralCString  s11("l");      nsStdCString      s12("lo");            tests_failed += test_readable_hello(s10+s11+s12);          }    {      const char *foo = "this is a really long string";      nsCString origString;      nsCString string2;      nsCString string3;      origString = foo;      string2 = Substring(origString, 0, 5);      string3 = Substring(origString, 6, origString.Length() - 6);    }    {      nsLiteralCString s13("He");      nsCAutoString    s14("l");      nsLiteralCString s15("lo");      s14.Assign(s13 + s14 + s15);      if ( int failures = test_readable_hello(s14) )        {          tests_failed += failures;          cout << "FAILED to keep a promise." << endl;        }    }    {      nsLiteralCString str1("Hello");      nsStdCString str2("Hello");      nsLiteralCString str3("Hello there");      if ( str1 != str2 )        {          cout << "string comparison using != failed" << endl;          ++tests_failed;        }      if ( !(str3 > str2) )        {          cout << "string comparison using > failed" << endl;          ++tests_failed;        }      if ( !(str2 < str3) )        {          cout << "string comparison using < failed" << endl;          ++tests_failed;        }      if ( str1 != "Hello" )        {          cout << "string comparison using == failed" << endl;          ++tests_failed;        }    }#if 0    nsStdCString extracted_middle("XXXXXXXXXX");    CallCMid(extracted_middle, part1+part2a+part2b, 1, 3);        cout << "The result of mid was \"" << extracted_middle << "\"" << endl;        nsLiteralCString middle_answer("ell");    if ( middle_answer != extracted_middle )      {        cout << "mid FAILED on nsConcatString" << endl;        ++tests_failed;      }      //      // |nsStdStringWrapper|, i.e., |nsStdCString|      //    {      nsStdCString extracted_middle;      CallCMid(extracted_middle, part1+part2a+part2b, 1, 3);     cout << "The result of mid was \"" << extracted_middle << "\"" << endl;      nsLiteralCString middle_answer("ell");      if ( middle_answer != extracted_middle )        {          cout << "mid FAILED on nsStdCString" << endl;          ++tests_failed;        }    }    nsStdCString leftString;    source.Left(leftString, 9);    // cout << static_cast<nsAReadableCString>(leftString) << endl;    tests_failed += test_multifragment_iterators(part1+part2a+part2b);#endif            cout << "End of string unit tests." << endl;    if ( !tests_failed )      cout << "OK, all tests passed." << endl;    else      cout << "FAILED one or more tests." << endl;  	return 0;  }