| 154 | */ |
| 155 | |
| 156 | int BytecodeTester::get_bytecode_version(const Vector<String> &bytecode_files) { |
| 157 | int bytecode_version = 0; |
| 158 | if (bytecode_files.size() == 0) { |
| 159 | return bytecode_version; |
| 160 | } |
| 161 | for (const String &file : bytecode_files) { |
| 162 | int this_ver = 0; |
| 163 | if (file.get_extension().to_lower() == "gde") { |
| 164 | this_ver = GDScriptDecomp::read_bytecode_version_encrypted(file, 3, GDRESettings::get_singleton()->get_encryption_key()); |
| 165 | } else { |
| 166 | this_ver = GDScriptDecomp::read_bytecode_version(file); |
| 167 | } |
| 168 | if (this_ver == -2) { |
| 169 | return -2; // encryption error |
| 170 | } |
| 171 | if (this_ver == -1) { |
| 172 | // WARN_PRINT("Could not read bytecode version from file: " + file); |
| 173 | continue; |
| 174 | } |
| 175 | if (bytecode_version == 0) { |
| 176 | bytecode_version = this_ver; |
| 177 | } else if (this_ver != bytecode_version) { |
| 178 | // Hell no. |
| 179 | return -1; |
| 180 | } |
| 181 | } |
| 182 | return bytecode_version; |
| 183 | } |
| 184 | |
| 185 | uint64_t BytecodeTester::generic_test(const Vector<String> &p_paths, int ver_major_hint, int ver_minor_hint, bool include_dev, bool print_log_on_fail) { |
| 186 | int detected_bytecode_version = get_bytecode_version(p_paths); |
no test coverage detected