From 65ace942fdabfd6116163a21eec7cd7bbd3cbcb1 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Mon, 25 Jul 2011 19:06:10 +0000 Subject: introduce getter and setter functions. some variables didn't always have a value reflecting the browser's internal state. for example, if `default_encoding` was never set then `print @default_encoding` would always print a blank string. this introduces getter functions that ensure the value of a variable is always in sync with the internal state of the browser. also: setters, because sometimes you need to process user input before storing it. --- tests/test-command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test-command.c') diff --git a/tests/test-command.c b/tests/test-command.c index 631f8c4..07f053c 100644 --- a/tests/test-command.c +++ b/tests/test-command.c @@ -188,13 +188,13 @@ test_set_variable (struct EventFixture *ef, const void *data) { parse_cmd_line("set nonexistant_variable = Some Value", NULL); ASSERT_EVENT(ef, "VARIABLE_SET nonexistant_variable str 'Some Value'"); uzbl_cmdprop *c = g_hash_table_lookup(uzbl.behave.proto_var, "nonexistant_variable"); - g_assert_cmpstr("Some Value", ==, *c->ptr.s); + g_assert_cmpstr("Some Value", ==, *(c->ptr.s)); /* set a custom variable with expansion */ parse_cmd_line("set an_expanded_variable = Test @(echo expansion)@", NULL); ASSERT_EVENT(ef, "VARIABLE_SET an_expanded_variable str 'Test expansion'"); c = g_hash_table_lookup(uzbl.behave.proto_var, "an_expanded_variable"); - g_assert_cmpstr("Test expansion", ==, *c->ptr.s); + g_assert_cmpstr("Test expansion", ==, *(c->ptr.s)); } void -- cgit v1.2.3