]> git.feebdaed.xyz Git - 0xmirror/radare2.git/commitdiff
Bring back the archos tests
authorpancake <trufae@gmail.com>
Fri, 19 Dec 2025 21:39:07 +0000 (22:39 +0100)
committerGitHub <noreply@github.com>
Fri, 19 Dec 2025 21:39:07 +0000 (22:39 +0100)
binr/r2r/load.c

index 56a2523c0da66435af5f7320bc6db9dd82e27213..49f9cecb25b1376705fc0cc25e03595419f08e30 100644 (file)
@@ -488,7 +488,6 @@ R_API RVecR2RJsonTestPtr *r2r_load_json_test_file(const char *file) {
        return ret;
 }
 
-
 static R2RTest *r2r_test_new(R2RTestType type, const char *path, void *specific_test, bool load_plugins) {
        R2RTest *test = R_NEW (R2RTest);
        test->type = type;
@@ -531,7 +530,7 @@ R_API void r2r_test_free(R2RTest *test) {
        free (test);
 }
 
-R_API R2RTestDatabase * R_NONNULL r2r_test_database_new(void) {
+R_API R2RTestDatabase *R_NONNULL r2r_test_database_new(void) {
        R2RTestDatabase *db = R_NEW (R2RTestDatabase);
        RVecR2RTestPtr_init (&db->tests);
        r_str_constpool_init (&db->strpool);
@@ -551,8 +550,10 @@ R_API void r2r_test_database_free(R2RTestDatabase *db) {
        free (db);
 }
 
+R_IPI const char *getarchos(void);
+
 static R2RTestFrom test_type_for_path(const char *path) {
-       R2RTestFrom res = {0};
+       R2RTestFrom res = { 0 };
        res.load_plugins = false;
        if (strstr (path, R_SYS_DIR "asm" R_SYS_DIR)) {
                res.type = R2R_TEST_TYPE_ASM;
@@ -565,7 +566,8 @@ static R2RTestFrom test_type_for_path(const char *path) {
                res.type = R2R_TEST_TYPE_CMD;
        }
        res.archos = false;
-       if (strstr (path, R_SYS_DIR "archos") || !strcmp (path, "archos")) {
+       if ((strstr (path, R_SYS_DIR "archos" R_SYS_DIR) || !strcmp (path, "archos")) &&
+           strcmp (path + strlen (path) - strlen (getarchos ()), getarchos ())) {
                res.archos = true;
        }
        return res;