summaryrefslogtreecommitdiff
path: root/test/lex-auto.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-11-27 12:14:07 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-11-27 12:14:07 +0000
commit7adaf92154adc7f3455769ca197f906e3d4cddaa (patch)
treeae172720c8e44a35b87b5506602768db19ec538f /test/lex-auto.c
parent79c0f3bc5c1581a6f2f6568a50e3b4f64b452541 (diff)
downloadlibcss-7adaf92154adc7f3455769ca197f906e3d4cddaa.tar.gz
libcss-7adaf92154adc7f3455769ca197f906e3d4cddaa.tar.bz2
css_string is now the same as a parserutils_dict_entry. This allows us to use dict entries directly as strings.
iChange the way in which selectors are represented. This significantly reduces memory requirements -- reducing the approximate usage count (excludes the string dictionary, which is about 360k) of allzengarden.css from 4,535,400 bytes to 2,414,312 bytes on a 64bit platform. The string dictionary is now created and owned by the stylesheet object. The parser is just given access to this so that it can store strings in it. svn path=/trunk/libcss/; revision=5809
Diffstat (limited to 'test/lex-auto.c')
-rw-r--r--test/lex-auto.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/lex-auto.c b/test/lex-auto.c
index d336480..10f097c 100644
--- a/test/lex-auto.c
+++ b/test/lex-auto.c
@@ -41,11 +41,11 @@ static css_token_type string_to_type(const char *data, size_t len);
static void run_test(const uint8_t *data, size_t len,
exp_entry *exp, size_t explen);
-static void *myrealloc(void *ptr, size_t len, void *pw)
+static void *myrealloc(void *data, size_t len, void *pw)
{
UNUSED(pw);
- return realloc(ptr, len);
+ return realloc(data, len);
}
int main(int argc, char **argv)
@@ -302,11 +302,11 @@ void run_test(const uint8_t *data, size_t len, exp_entry *exp, size_t explen)
assert(0 && "Text lengths differ");
}
- if (strncmp((char *) tok->data.ptr, exp[e].text,
+ if (strncmp((char *) tok->data.data, exp[e].text,
tok->data.len) != 0) {
printf("%d: Got data '%.*s', Expected '%.*s'\n",
testnum,
- (int) tok->data.len, tok->data.ptr,
+ (int) tok->data.len, tok->data.data,
(int) exp[e].textLen, exp[e].text);
assert(0 && "Text differs");
}