Compare commits

..

1 Commits

Author SHA1 Message Date
4d2b88d0e7 fix: windows roaming path should also be applied to USERPROFILE
done from mobile
2025-09-17 17:12:45 +02:00
2 changed files with 12 additions and 14 deletions

View File

@@ -7,8 +7,6 @@ A from-scratch rewrite of [mcaselector](https://github.com/Querz/mcaselector) in
[![licence](https://img.shields.io/github/license/thepigeongenerator/mcaselector-lite.svg)](https://github.com/thepigeongenerator/mcaselector-lite/blob/main/LICENSE)
[![issues](https://img.shields.io/github/issues/thepigeongenerator/mcaselector-lite.svg)](https://github.com/thepigeongenerator/mcaselector-lite/issues/)
[![CI-status](https://github.com/thepigeongenerator/mcaselector-lite/actions/workflows/ci.yaml/badge.svg)](https://github.com/thepigeongenerator/mcaselector-lite/actions/workflows/ci.yaml)
## what does it do
MCA selector lite is a tool used to edit [region files](https://minecraft.wiki/w/Region_file_format) of your [Minecraft java](https://minecraft.wiki/w/Java_Edition) worlds.
This is useful for reducing world size, general world management, perhaps copying chunks from one world to another or various other administrative tasks.

View File

@@ -12,15 +12,15 @@ void test_conf_procbuf(const char *restrict buf, const char *restrict expect_key
size_t len = strlen(buf) + 1;
char k[len], v[len];
*k = '\0', *v = '\0';
(void)(assert_true(conf_procbuf(buf, k, v, len) == expect_return) &&
assert_true(conf_procbuf(buf, k, v, len) == expect_return) &&
assert_true(!strcmp(k, expect_key)) &&
assert_true(!strcmp(v, expect_val)));
assert_true(!strcmp(v, expect_val));
}
void test_conf_matchopt(struct conf_entry *opts, size_t optc, const char *restrict key, int expect_index) {
size_t idx = opts - conf_matchopt(opts, optc, key);
idx = (ssize_t)idx < 0 ? -idx : idx;
int i = idx < optc ? (int)idx : -1;
idx = (ssize_t)idx < 0 ? -(ssize_t)idx : idx;
int i = idx < optc ? idx : -1;
assert_true(i == expect_index);
}
@@ -40,30 +40,30 @@ void test_conf_procval_f32(const char *val, f32 expect_value) {
void test_procval_str(void) {
char *out = NULL;
(void)(assert_true(!conf_procval(&(struct conf_entry){NULL, (void *)&out, CONF_STR}, "here comes the sowon")) &&
assert_false(strcmp("here comes the sowon", out)));
assert_true(!conf_procval(&(struct conf_entry){NULL, (void *)&out, CONF_STR}, "here comes the sowon")) &&
assert_false(strcmp("here comes the sowon", out));
free(out);
}
void test_procval_str_predef(void) {
char *out = strdup("owo");
(void)(assert_true(!conf_procval(&(struct conf_entry){NULL, (void *)&out, CONF_STR}, "i leak if I don't free")) &&
assert_true(!strcmp("i leak if I don't free", out)));
assert_true(!conf_procval(&(struct conf_entry){NULL, (void *)&out, CONF_STR}, "i leak if I don't free")) &&
assert_true(!strcmp("i leak if I don't free", out));
free(out);
}
void test_procval_fstr(void) {
char buf[16];
struct conf_fstr str = {sizeof(buf), buf};
(void)(assert_true(!conf_procval(&(struct conf_entry){NULL, &str, CONF_FSTR}, "hewwoo wowld")) &&
assert_true(!strcmp(str.out, "hewwoo wowld")));
assert_true(!conf_procval(&(struct conf_entry){NULL, &str, CONF_FSTR}, "hewwoo wowld")) &&
assert_true(!strcmp(str.out, "hewwoo wowld"));
}
void test_procval_fstr_trunc(void) {
char buf[8];
struct conf_fstr str = {sizeof(buf), buf};
(void)(assert_true(!conf_procval(&(struct conf_entry){NULL, &str, CONF_FSTR}, "hewwooo wowld")) &&
assert_true(!strcmp(str.out, "hewwooo")));
assert_true(!conf_procval(&(struct conf_entry){NULL, &str, CONF_FSTR}, "hewwooo wowld")) &&
assert_true(!strcmp(str.out, "hewwooo"));
}
void test_procval_eparse(void) {