From 17f96bc1455acaf3015e337f99aaac7b58c55dbb Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Thu, 17 Jun 2010 11:11:57 +0100 Subject: Added calculate location directory --- lib/tests/test_utils.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/tests') diff --git a/lib/tests/test_utils.c b/lib/tests/test_utils.c index 057c4845..763392a8 100644 --- a/lib/tests/test_utils.c +++ b/lib/tests/test_utils.c @@ -32,6 +32,7 @@ main (int argc, char **argv) state_key *temp_state_key = NULL; state_data *temp_state_data; time_t current_time; + char *temp_filename; plan_tests(81+23); @@ -259,10 +260,15 @@ main (int argc, char **argv) temp_string = np_state_generate_key(argv); ok(!strcmp(temp_string, "Ahash"), "Got hash" ); + temp_string = _np_state_calculate_location_prefix(); + ok(!strcmp(temp_string, NP_SHAREDSTATE_DIR), "Got default directory" ); + ok(temp_state_key==NULL, "temp_state_key initially empty"); temp_state_key = np_state_init("check_test", temp_string, 54); ok( !strcmp(temp_state_key->plugin_name, "check_test"), "Got plugin name" ); ok( !strcmp(temp_state_key->name, temp_string), "Got key name" ); + printf("Filename=%s\n", temp_state_key->_filename); + ok( !strcmp(temp_state_key->_filename, "Tobedone"), "Got internal filename" ); ok( temp_state_key->data_version==54, "Version set" ); -- cgit v1.2.3-74-g34f1