diff options
| author | Ton Voon <ton.voon@opsera.com> | 2010-06-17 11:11:57 +0100 |
|---|---|---|
| committer | Ton Voon <ton.voon@opsera.com> | 2010-06-17 11:11:57 +0100 |
| commit | 17f96bc1455acaf3015e337f99aaac7b58c55dbb (patch) | |
| tree | 7330b3044e346565339cbec004fc3a5c8e8982bc /lib/tests | |
| parent | 301599a4eca67e214ef79bd609843a9e1e710b3a (diff) | |
| download | monitoring-plugins-17f96bc1455acaf3015e337f99aaac7b58c55dbb.tar.gz | |
Added calculate location directory
Diffstat (limited to 'lib/tests')
| -rw-r--r-- | lib/tests/test_utils.c | 6 |
1 files changed, 6 insertions, 0 deletions
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) | |||
| 32 | state_key *temp_state_key = NULL; | 32 | state_key *temp_state_key = NULL; |
| 33 | state_data *temp_state_data; | 33 | state_data *temp_state_data; |
| 34 | time_t current_time; | 34 | time_t current_time; |
| 35 | char *temp_filename; | ||
| 35 | 36 | ||
| 36 | plan_tests(81+23); | 37 | plan_tests(81+23); |
| 37 | 38 | ||
| @@ -259,10 +260,15 @@ main (int argc, char **argv) | |||
| 259 | temp_string = np_state_generate_key(argv); | 260 | temp_string = np_state_generate_key(argv); |
| 260 | ok(!strcmp(temp_string, "Ahash"), "Got hash" ); | 261 | ok(!strcmp(temp_string, "Ahash"), "Got hash" ); |
| 261 | 262 | ||
| 263 | temp_string = _np_state_calculate_location_prefix(); | ||
| 264 | ok(!strcmp(temp_string, NP_SHAREDSTATE_DIR), "Got default directory" ); | ||
| 265 | |||
| 262 | ok(temp_state_key==NULL, "temp_state_key initially empty"); | 266 | ok(temp_state_key==NULL, "temp_state_key initially empty"); |
| 263 | temp_state_key = np_state_init("check_test", temp_string, 54); | 267 | temp_state_key = np_state_init("check_test", temp_string, 54); |
| 264 | ok( !strcmp(temp_state_key->plugin_name, "check_test"), "Got plugin name" ); | 268 | ok( !strcmp(temp_state_key->plugin_name, "check_test"), "Got plugin name" ); |
| 265 | ok( !strcmp(temp_state_key->name, temp_string), "Got key name" ); | 269 | ok( !strcmp(temp_state_key->name, temp_string), "Got key name" ); |
| 270 | printf("Filename=%s\n", temp_state_key->_filename); | ||
| 271 | |||
| 266 | ok( !strcmp(temp_state_key->_filename, "Tobedone"), "Got internal filename" ); | 272 | ok( !strcmp(temp_state_key->_filename, "Tobedone"), "Got internal filename" ); |
| 267 | ok( temp_state_key->data_version==54, "Version set" ); | 273 | ok( temp_state_key->data_version==54, "Version set" ); |
| 268 | 274 | ||
