#include "tests/ArrayTests.h" #include "tests/Test.h" #include "utils/Array.h" #include "utils/StringBuffer.h" typedef StringBuffer<50> String; static void testToString1(Test& test) { Array a; a[0] = 1; a[1] = 243; a[2] = -423; String s; s.append(a); test.checkEqual(String("[1, 243, -423]"), s, "array to string 1"); } static void testToString2(Test& test) { Array a; a[0] = 1; String s; s.append(a); test.checkEqual(String("[1]"), s, "array to string 2"); } void ArrayTests::test() { Test test("Array"); testToString1(test); testToString2(test); test.finalize(); }