--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.databoard.tests;
+
+import junit.framework.TestCase;\r
+\r
+import org.simantics.databoard.Datatypes;\r
+import org.simantics.databoard.annotations.Length;\r
+import org.simantics.databoard.type.ArrayType;\r
+import org.simantics.databoard.type.Datatype;\r
+import org.simantics.databoard.type.RecordType;\r
+import org.simantics.databoard.util.Range;\r
+
+public class TestMultiDimension extends TestCase {
+
+ public static class Image {
+
+ public Image() {}
+
+ public @Length({"320", "240"}) RGB[][] pixels;
+
+ }
+
+ public static class RGB {
+
+ int r;
+ int g;
+ int b;
+
+ }
+
+ public void testMultiDim() {
+ Datatype dt = Datatypes.getDatatypeUnchecked( Image.class );
+ RecordType rt = (RecordType) dt;
+ ArrayType at = (ArrayType) rt.getComponentType(0);
+ assertEquals(at.getLength(), Range.create(320));
+ ArrayType at2 = (ArrayType) at.componentType;
+ assertEquals(at2.getLength(), Range.create(240));
+
+ }
+
+}
+