// Path: ffsampledsp-java/src/main/java/com/tagtraum/ffsampledsp/FFNativeLibraryLoader.java
// static String decodeURL(final String s) {
//     boolean needToChange = false;
//     final int numChars = s.length();
//     final StringBuilder sb = new StringBuilder(numChars > 500 ? numChars / 2 : numChars);
//     int i = 0;
// 
//     char c;
//     byte[] bytes = null;
//     while (i < numChars) {
//         c = s.charAt(i);
// 
//         if (c == '%') {
//             /*
//              * Starting with this instance of %, process all
//              * consecutive substrings of the form %xy. Each
//              * substring %xy will yield a byte. Convert all
//              * consecutive  bytes obtained this way to whatever
//              * character(s) they represent in the provided
//              * encoding.
//              */
// 
//             try {
// 
//                 // (numChars-i)/3 is an upper bound for the number
//                 // of remaining bytes
//                 if (bytes == null) {
//                     bytes = new byte[(numChars - i) / 3];
//                 }
//                 int pos = 0;
// 
//                 while (((i+2) < numChars) && (c=='%')) {
//                     int v = Integer.parseInt(s.substring(i+1,i+3),16);
//                     if (v < 0) {
//                         throw new IllegalArgumentException("FFNativeLibraryLoader: Illegal hex characters in escape (%) pattern - negative value");
//                     }
//                     bytes[pos++] = (byte) v;
//                     i+= 3;
//                     if (i < numChars) {
//                         c = s.charAt(i);
//                     }
//                 }
// 
//                 // A trailing, incomplete byte encoding such as
//                 // "%x" will cause an exception to be thrown
//                 if ((i < numChars) && (c=='%')) {
//                     throw new IllegalArgumentException("FFNativeLibraryLoader: Incomplete trailing escape (%) pattern");
//                 }
// 
//                 sb.append(new String(bytes, 0, pos, UTF_8));
//             } catch (NumberFormatException e) {
//                 throw new IllegalArgumentException("FFNativeLibraryLoader: Illegal hex characters in escape (%) pattern - " + e.getMessage());
//             }
//             needToChange = true;
//         } else {
//             sb.append(c);
//             i++;
//         }
//     }
//     return needToChange ? sb.toString() : s;
// }


import org.junit.Test;
import java.io.*;
import static com.tagtraum.ffsampledsp.FFNativeLibraryLoader.decodeURL;
import static org.junit.Assert.assertEquals;
/*
 * =================================================
 * Copyright 2021 tagtraum industries incorporated
 * All rights reserved.
 * =================================================
 */
package com.tagtraum.ffsampledsp;




/**
 * TestFFNativeLibraryLoader.
 *
 * @author <a href="mailto:hs@tagtraum.com">Hendrik Schreiber</a>
 */
public class TestFFNativeLibraryLoader {

    @Test(expected = FileNotFoundException.class)
    public void testFindNonExistingFile() throws FileNotFoundException {
        FFNativeLibraryLoader.findFile("testFindFile", FFNativeLibraryLoader.class, new FileFilter() {
            @Override
            public boolean accept(final File pathname) {
                return false;
            }
// Path: ffsampledsp-java/src/main/java/com/tagtraum/ffsampledsp/FFNativeLibraryLoader.java
// static String decodeURL(final String s) {
//     boolean needToChange = false;
//     final int numChars = s.length();
//     final StringBuilder sb = new StringBuilder(numChars > 500 ? numChars / 2 : numChars);
//     int i = 0;
// 
//     char c;
//     byte[] bytes = null;
//     while (i < numChars) {
//         c = s.charAt(i);
// 
//         if (c == '%') {
//             /*
//              * Starting with this instance of %, process all
//              * consecutive substrings of the form %xy. Each
//              * substring %xy will yield a byte. Convert all
//              * consecutive  bytes obtained this way to whatever
//              * character(s) they represent in the provided
//              * encoding.
//              */
// 
//             try {
// 
//                 // (numChars-i)/3 is an upper bound for the number
//                 // of remaining bytes
//                 if (bytes == null) {
//                     bytes = new byte[(numChars - i) / 3];
//                 }
//                 int pos = 0;
// 
//                 while (((i+2) < numChars) && (c=='%')) {
//                     int v = Integer.parseInt(s.substring(i+1,i+3),16);
//                     if (v < 0) {
//                         throw new IllegalArgumentException("FFNativeLibraryLoader: Illegal hex characters in escape (%) pattern - negative value");
//                     }
//                     bytes[pos++] = (byte) v;
//                     i+= 3;
//                     if (i < numChars) {
//                         c = s.charAt(i);
//                     }
//                 }
// 
//                 // A trailing, incomplete byte encoding such as
//                 // "%x" will cause an exception to be thrown
//                 if ((i < numChars) && (c=='%')) {
//                     throw new IllegalArgumentException("FFNativeLibraryLoader: Incomplete trailing escape (%) pattern");
//                 }
// 
//                 sb.append(new String(bytes, 0, pos, UTF_8));
//             } catch (NumberFormatException e) {
//                 throw new IllegalArgumentException("FFNativeLibraryLoader: Illegal hex characters in escape (%) pattern - " + e.getMessage());
//             }
//             needToChange = true;
//         } else {
//             sb.append(c);
//             i++;
//         }
//     }
//     return needToChange ? sb.toString() : s;
// }


// Path: ffsampledsp-complete/src/test/java/com/tagtraum/ffsampledsp/TestFFNativeLibraryLoader.java
import org.junit.Test;
import java.io.*;
import static com.tagtraum.ffsampledsp.FFNativeLibraryLoader.decodeURL;
import static org.junit.Assert.assertEquals;

/*
 * =================================================
 * Copyright 2021 tagtraum industries incorporated
 * All rights reserved.
 * =================================================
 */
package com.tagtraum.ffsampledsp;




/**
 * TestFFNativeLibraryLoader.
 *
 * @author <a href="mailto:hs@tagtraum.com">Hendrik Schreiber</a>
 */
public class TestFFNativeLibraryLoader {

    @Test(expected = FileNotFoundException.class)
    public void testFindNonExistingFile() throws FileNotFoundException {
        FFNativeLibraryLoader.findFile("testFindFile", FFNativeLibraryLoader.class, new FileFilter() {
            @Override
            public boolean accept(final File pathname) {
                return false;
            }
        });