/*
 * Copyright © 2015 <code@io7m.com> http://io7m.com
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
 * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

package com.io7m.junsigned.tests.core;

import com.io7m.junreachable.UnreachableCodeException;
import org.junit.Test;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public final class UnreachableTest
{
  private static void execNoArgPrivateConstructor(final String name)
    throws
    ClassNotFoundException,
    InstantiationException,
    IllegalAccessException
  {
    try {
      final Class<?> c = Class.forName(name);
      final Constructor<?>[] cons = c.getDeclaredConstructors();
      cons[0].setAccessible(true);
      cons[0].newInstance();
    } catch (final InvocationTargetException e) {
      throw (UnreachableCodeException) e.getCause();
    }
  }

  @Test(expected = UnreachableCodeException.class)
  public void testUnsignedFloat()
    throws Exception
  {
    UnreachableTest.execNoArgPrivateConstructor(
      "com.io7m.junsigned.core.UnsignedFloat");
  }

  @Test(expected = UnreachableCodeException.class)
  public void testUnsignedDouble()
    throws Exception
  {
    UnreachableTest.execNoArgPrivateConstructor(
      "com.io7m.junsigned.core.UnsignedDouble");
  }
}

@@ -1612,32 +1612,16 @@
   %7B%0A    
-UnreachableTest.
 execNoAr
@@ -1632,39 +1632,32 @@
 vateConstructor(
-%0A      
 %22com.io7m.junsig
@@ -1806,59 +1806,410 @@
     
-UnreachableTest.execNoArgPrivateConstructor(%0A      
+execNoArgPrivateConstructor(%22com.io7m.junsigned.core.UnsignedDouble%22);%0A  %7D%0A%0A  @Test(expected = UnreachableCodeException.class)%0A  public void testUnsignedInt()%0A    throws Exception%0A  %7B%0A    execNoArgPrivateConstructor(%22com.io7m.junsigned.core.UnsignedInt%22);%0A  %7D%0A%0A  @Test(expected = UnreachableCodeException.class)%0A  public void testUnsignedLong()%0A    throws Exception%0A  %7B%0A    execNoArgPrivateConstructor(
 %22com
@@ -2229,32 +2229,30 @@
 ed.core.Unsigned
-Double
+Long
 %22);%0A  %7D%0A%7D%0A

Add unreachable tests missing from commit