/*
 * Copyright © 2016 <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.r2.tests.core;

import com.io7m.junreachable.UnreachableCodeException;
import com.io7m.r2.core.R2Bilinear;
import com.io7m.r2.core.R2Core;
import com.io7m.r2.core.R2Projections;
import com.io7m.r2.core.shaders.types.R2ShaderParameters;
import com.io7m.r2.core.R2Stencils;
import org.junit.Test;

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

/**
 * Abuse reflection to verify that code marked as unreachable really is
 * unreachable.
 */

public final class R2UnreachableTest
{
  private static void checkUnreachable(final Class<?> c)
    throws Throwable
  {
    try {
      final Constructor<?> cc = c.getDeclaredConstructors()[0];
      cc.setAccessible(true);
      cc.newInstance();
    } catch (final InvocationTargetException e) {
      throw e.getCause();
    }
  }

  @Test(expected = UnreachableCodeException.class)
  public void testBilinear()
    throws Throwable
  {
    R2UnreachableTest.checkUnreachable(R2Bilinear.class);
  }

  @Test(expected = UnreachableCodeException.class)
  public void testCore()
    throws Throwable
  {
    R2UnreachableTest.checkUnreachable(R2Core.class);
  }

  @Test(expected = UnreachableCodeException.class)
  public void testProjections()
    throws Throwable
  {
    R2UnreachableTest.checkUnreachable(R2Projections.class);
  }

  @Test(expected = UnreachableCodeException.class)
  public void testShaderParameters()
    throws Throwable
  {
    R2UnreachableTest.checkUnreachable(R2ShaderParameters.class);
  }

  @Test(expected = UnreachableCodeException.class)
  public void testStencils()
    throws Throwable
  {
    R2UnreachableTest.checkUnreachable(R2Stencils.class);
  }
}

@@ -873,16 +873,64 @@
 eption;%0A
+import com.io7m.r2.core.R2AttributeConventions;%0A
 import c
@@ -1015,26 +1015,211 @@
 .core.R2
-Projection
+IndexBuffers;%0Aimport com.io7m.r2.core.R2Projections;%0Aimport com.io7m.r2.core.R2RenderTargetDescriptions;%0Aimport com.io7m.r2.core.R2Stencils;%0Aimport com.io7m.r2.core.debug.R2DebugVisualizerDefault
 s;%0Aimpor
@@ -1291,33 +1291,54 @@
 o7m.r2.core.
-R2Stencil
+shaders.types.R2ShaderVerifier
 s;%0Aimport or
@@ -1872,24 +1872,972 @@
 %0A    %7D%0A  %7D%0A%0A
+  @Test(expected = UnreachableCodeException.class)%0A  public void testAttributeConventions()%0A    throws Throwable%0A  %7B%0A    R2UnreachableTest.checkUnreachable(R2AttributeConventions.class);%0A  %7D%0A%0A  @Test(expected = UnreachableCodeException.class)%0A  public void testIndexBuffers()%0A    throws Throwable%0A  %7B%0A    R2UnreachableTest.checkUnreachable(R2IndexBuffers.class);%0A  %7D%0A%0A  @Test(expected = UnreachableCodeException.class)%0A  public void testRenderTargetDescriptions()%0A    throws Throwable%0A  %7B%0A    R2UnreachableTest.checkUnreachable(R2RenderTargetDescriptions.class);%0A  %7D%0A%0A  @Test(expected = UnreachableCodeException.class)%0A  public void testDebugVisualizerDefaults()%0A    throws Throwable%0A  %7B%0A    R2UnreachableTest.checkUnreachable(R2DebugVisualizerDefaults.class);%0A  %7D%0A%0A  @Test(expected = UnreachableCodeException.class)%0A  public void testShaderVerifiers()%0A    throws Throwable%0A  %7B%0A    R2UnreachableTest.checkUnreachable(R2ShaderVerifiers.class);%0A  %7D%0A%0A
   @Test(expe

Add missing unreachable tests