diff options
Diffstat (limited to 'embedding/csharp/uSCXMLEmbedding')
-rw-r--r-- | embedding/csharp/uSCXMLEmbedding/RunTests.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/embedding/csharp/uSCXMLEmbedding/RunTests.cs b/embedding/csharp/uSCXMLEmbedding/RunTests.cs index 38e3736..d2b188d 100644 --- a/embedding/csharp/uSCXMLEmbedding/RunTests.cs +++ b/embedding/csharp/uSCXMLEmbedding/RunTests.cs @@ -32,6 +32,7 @@ namespace embedding int i = 1;
while (i-- > 0)
{
+ testData();
testLifeCycle();
testExecutableContent();
testIOProcessor();
@@ -40,6 +41,34 @@ namespace embedding Console.ReadKey();
}
+ public static void testData() {
+ byte[] origData = new byte[1024];
+ for (int i = 0; i < origData.Length; i++) {
+ origData[i] = (byte)i;
+ }
+
+ {
+
+ Blob blob = new Blob(origData, "application/octet-stream");
+ Debug.Assert(origData.Length == blob.getSize());
+
+ for (int i = 0; i < origData.Length; i++) {
+ Debug.Assert(origData[i] == blob.getData()[i]);
+ }
+ }
+
+ Data data = new Data(origData, "application/octet-stream");
+ Blob blob2 = data.getBinary();
+
+ byte[] newData = blob2.getData();
+
+ if (newData.Length == origData.Length);
+ for (int i = 0; i < origData.Length; i++) {
+ Debug.Assert(newData[i] == origData[i]);
+ }
+
+ }
+
public static void testInvoker() {
Console.WriteLine("testInvoker");
CustomInvoker invoker = new CustomInvoker();
|