- KEY_NAME_INVALID_READ);
- if ((val != NULL) &&
- (strcmp(val, VALUE1) == 0)) {
- printf("pl, should not be possible to read invalid key value.\n");
- return 0;
- }
- else {
- printf("error, value was supposed to be NULL, but is: %s\n", val);
+ KEY_NAME);
+ if ((val != NULL) &&
+ (strcmp(val, VALUE1) == 0)) {
+ printf("value 1 read ok: %s\n", val);
+ free(val);
+ }
+ else {
+ printf("failed to read value\n");
+ return 1;
+ }
+
+ val = get_config_value_and_close(work_dir,
+ CONF_FILENAME,
+ SECTION_NAME,
+ KEY_NAME_INVALID_READ);
+ if ((val != NULL) &&
+ (strcmp(val, VALUE1) == 0)) {
+ printf("pl, should not be possible to read invalid key value.\n");
+ return 0;
+ }
+ else {
+ printf("error, value was supposed to be NULL, but is: %s\n", val);
+ }
+ set_config_value_and_save(work_dir,
+ CONF_FILENAME,
+ SECTION_TYPE,
+ SECTION_NAME,
+ KEY_NAME,
+ VALUE2);
+ set_config_value_and_save(work_dir,
+ CONF_FILENAME,
+ SECTION_TYPE,
+ SECTION_NAME,
+ KEY_NAME2,
+ VALUE3);
+ set_config_value_and_save(work_dir,
+ CONF_FILENAME,
+ SECTION_TYPE2,
+ SECTION_NAME2,
+ KEY_NAME3,
+ VALUE4);