// Path: se.bitcraze.crazyflie.lib/src/test/java/se/bitcraze/crazyflie/lib/OfflineTests.java
// public interface OfflineTests {
// 
// }
// 
// Path: se.bitcraze.crazyflie.lib/src/main/java/se/bitcraze/crazyflie/lib/bootloader/Target.java
// public static class TargetTypes {
//     public static final int STM32 = 0xFF;
//     public static final int NRF51 = 0xFE;
// 
//     private TargetTypes() {
//         throw new IllegalStateException("Utility class");
//     }
// 
//     public static String toString(int target) {
//         if (target == TargetTypes.STM32) {
//             return "stm32";
//         } else if (target == TargetTypes.NRF51) {
//             return "nrf51";
//         }
//         return "Unknown";
//     }
// 
//     public static int fromString(String name) {
//         if ("stm32".equalsIgnoreCase(name)) {
//             return TargetTypes.STM32;
//         } else if ("nrf51".equalsIgnoreCase(name)) {
//             return TargetTypes.NRF51;
//         }
//         return 0;
//     }
// }


import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import se.bitcraze.crazyflie.lib.OfflineTests;
import se.bitcraze.crazyflie.lib.bootloader.Target.TargetTypes;

        assertEquals(TargetTypes.STM32, TargetTypes.fromString("stm32"));
        assertEquals(TargetTypes.NRF51, TargetTypes.fromString("nrf51"));
        assertEquals(0, TargetTypes.fromString("foobar"));
    }

    @Test
    public void testTarget() {
        //TODO fix this
        Target t0 = new Target(0xFF);
        System.out.println(t0.toString());

        Target t1 = new Target(0xFE);
        System.out.println(t1.toString());

        Target t2 = new Target(123);
        System.out.println(t2.toString());
    }

    @Test
    public void testSetAddress() {
        //TODO: is this working as expected?
        byte[] newAddress = new byte[5];
        newAddress[0] = (byte) 0xbc;
        for (int n = 1; n < 5; n++) {
            int zahl = (int) ((Math.random()*1000) % 255);
            System.out.print(zahl + ", ");
            newAddress[n] = (byte) zahl;
        }
        System.out.println();
// Path: se.bitcraze.crazyflie.lib/src/test/java/se/bitcraze/crazyflie/lib/OfflineTests.java
// public interface OfflineTests {
// 
// }
// 
// Path: se.bitcraze.crazyflie.lib/src/main/java/se/bitcraze/crazyflie/lib/bootloader/Target.java
// public static class TargetTypes {
//     public static final int STM32 = 0xFF;
//     public static final int NRF51 = 0xFE;
// 
//     private TargetTypes() {
//         throw new IllegalStateException("Utility class");
//     }
// 
//     public static String toString(int target) {
//         if (target == TargetTypes.STM32) {
//             return "stm32";
//         } else if (target == TargetTypes.NRF51) {
//             return "nrf51";
//         }
//         return "Unknown";
//     }
// 
//     public static int fromString(String name) {
//         if ("stm32".equalsIgnoreCase(name)) {
//             return TargetTypes.STM32;
//         } else if ("nrf51".equalsIgnoreCase(name)) {
//             return TargetTypes.NRF51;
//         }
//         return 0;
//     }
// }


// Path: se.bitcraze.crazyflie.lib/src/test/java/se/bitcraze/crazyflie/lib/bootloader/UtilitiesTest.java
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import se.bitcraze.crazyflie.lib.OfflineTests;
import se.bitcraze.crazyflie.lib.bootloader.Target.TargetTypes;


        assertEquals(TargetTypes.STM32, TargetTypes.fromString("stm32"));
        assertEquals(TargetTypes.NRF51, TargetTypes.fromString("nrf51"));
        assertEquals(0, TargetTypes.fromString("foobar"));
    }

    @Test
    public void testTarget() {
        //TODO fix this
        Target t0 = new Target(0xFF);
        System.out.println(t0.toString());

        Target t1 = new Target(0xFE);
        System.out.println(t1.toString());

        Target t2 = new Target(123);
        System.out.println(t2.toString());
    }

    @Test
    public void testSetAddress() {
        //TODO: is this working as expected?
        byte[] newAddress = new byte[5];
        newAddress[0] = (byte) 0xbc;
        for (int n = 1; n < 5; n++) {
            int zahl = (int) ((Math.random()*1000) % 255);
            System.out.print(zahl + ", ");
            newAddress[n] = (byte) zahl;
        }
        System.out.println();
        System.out.println(Arrays.toString(newAddress));