summaryrefslogtreecommitdiffstats
path: root/lib/tests/test_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tests/test_utils.c')
-rw-r--r--lib/tests/test_utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/tests/test_utils.c b/lib/tests/test_utils.c
index 6e04bfc..e90d4fb 100644
--- a/lib/tests/test_utils.c
+++ b/lib/tests/test_utils.c
@@ -355,7 +355,7 @@ main (int argc, char **argv)
355 unlink("var/generated"); 355 unlink("var/generated");
356 temp_state_key->_filename="var/generated"; 356 temp_state_key->_filename="var/generated";
357 current_time=1234567890; 357 current_time=1234567890;
358 np_state_write_string(&current_time, "String to read"); 358 np_state_write_string(current_time, "String to read");
359 ok(system("cmp var/generated var/statefile")==0, "Generated file same as expected"); 359 ok(system("cmp var/generated var/statefile")==0, "Generated file same as expected");
360 360
361 361
@@ -365,20 +365,20 @@ main (int argc, char **argv)
365 unlink("var/generated_directory"); 365 unlink("var/generated_directory");
366 temp_state_key->_filename="var/generated_directory/statefile"; 366 temp_state_key->_filename="var/generated_directory/statefile";
367 current_time=1234567890; 367 current_time=1234567890;
368 np_state_write_string(&current_time, "String to read"); 368 np_state_write_string(current_time, "String to read");
369 ok(system("cmp var/generated_directory/statefile var/statefile")==0, "Have created directory"); 369 ok(system("cmp var/generated_directory/statefile var/statefile")==0, "Have created directory");
370 370
371 /* This test to check cannot write to dir - can't automate yet */ 371 /* This test to check cannot write to dir - can't automate yet */
372 /* 372 /*
373 unlink("var/generated_bad_dir"); 373 unlink("var/generated_bad_dir");
374 mkdir("var/generated_bad_dir", S_IRUSR); 374 mkdir("var/generated_bad_dir", S_IRUSR);
375 np_state_write_string(&current_time, "String to read"); 375 np_state_write_string(current_time, "String to read");
376 */ 376 */
377 377
378 378
379 temp_state_key->_filename="var/generated"; 379 temp_state_key->_filename="var/generated";
380 time(&current_time); 380 time(&current_time);
381 np_state_write_string(NULL, "String to read"); 381 np_state_write_string(0, "String to read");
382 temp_state_data = np_state_read(temp_state_key); 382 temp_state_data = np_state_read(temp_state_key);
383 /* Check time is set to current_time */ 383 /* Check time is set to current_time */
384 ok(system("cmp var/generated var/statefile > /dev/null")!=0, "Generated file should be different this time"); 384 ok(system("cmp var/generated var/statefile > /dev/null")!=0, "Generated file should be different this time");
@@ -388,7 +388,7 @@ main (int argc, char **argv)
388 /* Don't know how to automatically test this. Need to be able to redefine die and catch the error */ 388 /* Don't know how to automatically test this. Need to be able to redefine die and catch the error */
389 /* 389 /*
390 temp_state_key->_filename="/dev/do/not/expect/to/be/able/to/write"; 390 temp_state_key->_filename="/dev/do/not/expect/to/be/able/to/write";
391 np_state_write_string(NULL, "Bad file"); 391 np_state_write_string(0, "Bad file");
392 */ 392 */
393 393
394 394