2 * Copyright (C) 2004, Christian Thaeter <chth@gmx.net>
4 * This file is part of the MaLa extension Language.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, contact me.
22 #define MALA_GLIBC /*TODO remove*/
23 #include "../engine/strings.h"
25 #define TEST(t) printf("TEST %s: ",#t);\
27 if((t))printf(".. OK\n");\
28 else printf(".. FAILED\n")
30 #define TEST_VOID(t) printf("TEST %s: ",#t);\
31 fflush(stdout); t; printf(".. OK\n")
37 MalaStringBucket test
= MALA_STRINGBUCKET_STATIC (MALA_STRING_FWD
,0);
41 TEST(a
= mala_string_new ("bar", test
));
42 TEST(b
= mala_string_new ("baz", test
));
43 TEST(c
= mala_string_new ("bar", test
));
44 TEST(d
= mala_string_new ("bar", NULL
));
45 TEST_VOID(mala_stringbucket_erase (test
));
46 TEST_VOID(mala_string_free (d
));
52 //MalaStringBucket test = MALA_STRINGBUCKET_STATIC (MALA_STRING_FWD,0);
54 MalaString a
; //,b,c,d;
56 MalaString onetwothreefour
= MALA_STRING_STATIC("1234");
58 TEST(a
= mala_string_new_print(NULL
, "%d",1234));
59 TEST(mala_string_compare (a
, onetwothreefour
) == 0);
60 TEST(mala_string_length (a
) == 4);
78 // arch-tag: 99da2844-99b2-4ec3-81ed-32db697656ec