// Path: src/main/java/com/technofovea/hllib/enums/PackageType.java
// public enum PackageType implements JnaEnum<PackageType> {
// 
//     NONE,
//     BSP,
//     GCF,
//     PAK,
//     VBSP,
//     WAD,
//     XZP,
//     ZIP,
//     NCF,
//     VPK;
//     
//     private static int start = 0;
// 
//     public int getIntValue() {
//         return this.ordinal() + start;
//     }
// 
//     public PackageType getForValue(
//             int i) {
//         for (PackageType o : this.values()) {
//             if (o.getIntValue() == i) {
//                 return o;
//             }
// 
//         }
//         return null;
//     }
// }
// 
// Path: src/main/java/com/technofovea/hllib/masks/FileMode.java
// public class FileMode extends MappedMask{
//     
// 	public static final int INDEX_MODE_READ= 0;
// 	public static final int INDEX_MODE_WRITE= 1;
// 	public static final int INDEX_MODE_CREATE= 2;
// 	public static final int INDEX_MODE_VOLATILE= 3;
// 	public static final int INDEX_MODE_NO_FILEMAPPING= 4;
// 	public static final int INDEX_MODE_QUICK_FILEMAPPING= 5;
// 
// }
// 
// Path: src/main/java/com/technofovea/hllib/methods/ManagedLibrary.java
// public interface ManagedLibrary extends BasicLibrary, ManagedCalls{       
// 
// }


import com.technofovea.hllib.enums.PackageType;
import com.technofovea.hllib.masks.FileMode;
import com.technofovea.hllib.methods.ManagedLibrary;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import junit.framework.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
package com.technofovea.hllib;


/**
 * @author Darien Hager
 */
public class PointerInvalidationTest {

    static ManagedLibrary fixture;

    @BeforeClass
    public static void BeforeClass() throws Exception {
        DllPathFinder.setJnaPathPath();
        fixture = HlLib.getLibrary();
    }

    @Before
    public void setup() throws Exception {
        Assert.assertTrue(HlLib.handler.lackey.openPackages.size() == 0);
        Assert.assertTrue(HlPackage.cache.map.size() == 0);
    }

    @After
    public void teardown() throws Exception {
        Assert.assertTrue(HlLib.handler.lackey.openPackages.size() == 0);
        Assert.assertTrue(HlPackage.cache.map.size() == 0);
    }

    @Test(expected = IllegalStateException.class)
    public void packageRootFailure() throws Exception {

        File target = new File(GcfFinder.getTestGcf().toURI());
// Path: src/main/java/com/technofovea/hllib/enums/PackageType.java
// public enum PackageType implements JnaEnum<PackageType> {
// 
//     NONE,
//     BSP,
//     GCF,
//     PAK,
//     VBSP,
//     WAD,
//     XZP,
//     ZIP,
//     NCF,
//     VPK;
//     
//     private static int start = 0;
// 
//     public int getIntValue() {
//         return this.ordinal() + start;
//     }
// 
//     public PackageType getForValue(
//             int i) {
//         for (PackageType o : this.values()) {
//             if (o.getIntValue() == i) {
//                 return o;
//             }
// 
//         }
//         return null;
//     }
// }
// 
// Path: src/main/java/com/technofovea/hllib/masks/FileMode.java
// public class FileMode extends MappedMask{
//     
// 	public static final int INDEX_MODE_READ= 0;
// 	public static final int INDEX_MODE_WRITE= 1;
// 	public static final int INDEX_MODE_CREATE= 2;
// 	public static final int INDEX_MODE_VOLATILE= 3;
// 	public static final int INDEX_MODE_NO_FILEMAPPING= 4;
// 	public static final int INDEX_MODE_QUICK_FILEMAPPING= 5;
// 
// }
// 
// Path: src/main/java/com/technofovea/hllib/methods/ManagedLibrary.java
// public interface ManagedLibrary extends BasicLibrary, ManagedCalls{       
// 
// }


// Path: src/test/java/com/technofovea/hllib/PointerInvalidationTest.java
import com.technofovea.hllib.enums.PackageType;
import com.technofovea.hllib.masks.FileMode;
import com.technofovea.hllib.methods.ManagedLibrary;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import junit.framework.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

package com.technofovea.hllib;


/**
 * @author Darien Hager
 */
public class PointerInvalidationTest {

    static ManagedLibrary fixture;

    @BeforeClass
    public static void BeforeClass() throws Exception {
        DllPathFinder.setJnaPathPath();
        fixture = HlLib.getLibrary();
    }

    @Before
    public void setup() throws Exception {
        Assert.assertTrue(HlLib.handler.lackey.openPackages.size() == 0);
        Assert.assertTrue(HlPackage.cache.map.size() == 0);
    }

    @After
    public void teardown() throws Exception {
        Assert.assertTrue(HlLib.handler.lackey.openPackages.size() == 0);
        Assert.assertTrue(HlPackage.cache.map.size() == 0);
    }

    @Test(expected = IllegalStateException.class)
    public void packageRootFailure() throws Exception {

        File target = new File(GcfFinder.getTestGcf().toURI());
        FileMode fm = new FileMode();