| 149 | cbm_unsetenv(names[2]) == 0 && cbm_unsetenv(names[3]) == 0; |
| 150 | } |
| 151 | static bool pf_close(pf_fixture_t *f) { |
| 152 | cbm_set_user_lang_config(f->previous_global); |
| 153 | bool ok = true; |
| 154 | if (f->env_saved) |
| 155 | for (size_t i = 0; i < 4; ++i) { |
| 156 | pf_env_value_t *v = &f->env[i]; |
| 157 | int rc = v->present ? cbm_setenv(v->name, v->value, 1) : cbm_unsetenv(v->name); |
| 158 | const char *now = getenv(v->name); |
| 159 | if (rc || (v->present ? !pf_text(now, v->value) : now != NULL)) |
| 160 | ok = false; |
| 161 | } |
| 162 | if (f->home[0] && th_rmtree(f->home)) |
| 163 | ok = false; |
| 164 | return ok; |
| 165 | } |
| 166 | static bool pf_open(pf_fixture_t *f) { |
| 167 | memset(f, 0, sizeof(*f)); |
| 168 | f->previous_global = cbm_get_user_lang_config(); |
no test coverage detected