diff options
author | csharptest <roger@csharptest.net> | 2012-10-12 18:22:48 -0500 |
---|---|---|
committer | rogerk <devnull@localhost> | 2012-10-12 18:22:48 -0500 |
commit | ad73b4250d906757b290a8a53d4544a623a7e0d8 (patch) | |
tree | c423bc677dafa155103ea5bcf01a16f8e0ca4de4 /src/ProtocolBuffers.Test/TextFormatTest.cs | |
parent | 3cf3315370c3aff09353bb0bf3808d67c9e92eda (diff) | |
download | protobuf-ad73b4250d906757b290a8a53d4544a623a7e0d8.tar.gz protobuf-ad73b4250d906757b290a8a53d4544a623a7e0d8.tar.bz2 protobuf-ad73b4250d906757b290a8a53d4544a623a7e0d8.zip |
Fixing build for SILVERLIGHT and COMPACT_FRAMEWORK before adding more build
variations (WP). Changes are primarily superficial since they are to support
the Serialization assembly and unit tests compiling in the CF which has not
been done before.
Diffstat (limited to 'src/ProtocolBuffers.Test/TextFormatTest.cs')
-rw-r--r-- | src/ProtocolBuffers.Test/TextFormatTest.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ProtocolBuffers.Test/TextFormatTest.cs b/src/ProtocolBuffers.Test/TextFormatTest.cs index 299b2650..10ab4e15 100644 --- a/src/ProtocolBuffers.Test/TextFormatTest.cs +++ b/src/ProtocolBuffers.Test/TextFormatTest.cs @@ -41,6 +41,7 @@ using Google.ProtocolBuffers.TestProtos; using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Globalization;
using System.Threading;
+#if !SILVERLIGHT && !COMPACT_FRAMEWORK
namespace Google.ProtocolBuffers
{
@@ -175,7 +176,10 @@ namespace Google.ProtocolBuffers /// </summary>
private static ByteString Bytes(string str)
{
- return ByteString.CopyFrom(Encoding.GetEncoding(28591).GetBytes(str));
+ byte[] bytes = new byte[str.Length];
+ for (int i = 0; i < bytes.Length; i++)
+ bytes[i] = (byte)str[i];
+ return ByteString.CopyFrom(bytes);
}
[TestMethod]
@@ -568,4 +572,5 @@ namespace Google.ProtocolBuffers Assert.AreEqual(longText, builder.OptionalString);
}
}
-}
\ No newline at end of file +}
+#endif
\ No newline at end of file |