Merge "Make test encoder test driver less likely to leak on failure." into nextgenv2
diff --git a/examples.mk b/examples.mk
index 593c8dd..cf98b99 100644
--- a/examples.mk
+++ b/examples.mk
@@ -218,13 +218,13 @@
 # If vp9 is enabled, $(CONFIG_VP9_ENCODER) is yes, otherwise, it is blank.
 ifneq (,$(filter yes,$(CONFIG_VP9_ENCODER) $(CONFIG_VP10_ENCODER)))
 ifeq ($(CONFIG_DECODERS),yes)
-EXAMPLES-yes                       += vpx_cx_set_ref.c
-vpx_cx_set_ref.SRCS                += ivfenc.h ivfenc.c
-vpx_cx_set_ref.SRCS                += tools_common.h tools_common.c
-vpx_cx_set_ref.SRCS                += video_common.h
-vpx_cx_set_ref.SRCS                += video_writer.h video_writer.c
-vpx_cx_set_ref.GUID                 = 65D7F14A-2EE6-4293-B958-AB5107A03B55
-vpx_cx_set_ref.DESCRIPTION          = VP9/VP10 set encoder reference frame
+EXAMPLES-yes                       += vpxcx_set_ref.c
+vpxcx_set_ref.SRCS                 += ivfenc.h ivfenc.c
+vpxcx_set_ref.SRCS                 += tools_common.h tools_common.c
+vpxcx_set_ref.SRCS                 += video_common.h
+vpxcx_set_ref.SRCS                 += video_writer.h video_writer.c
+vpxcx_set_ref.GUID                  = 65D7F14A-2EE6-4293-B958-AB5107A03B55
+vpxcx_set_ref.DESCRIPTION           = VP9/VP10 set encoder reference frame
 endif
 endif
 
diff --git a/examples/vpx_cx_set_ref.c b/examples/vpxcx_set_ref.c
similarity index 99%
rename from examples/vpx_cx_set_ref.c
rename to examples/vpxcx_set_ref.c
index 61d81b8..1039362 100644
--- a/examples/vpx_cx_set_ref.c
+++ b/examples/vpxcx_set_ref.c
@@ -306,7 +306,7 @@
   unsigned int frame_out = 0;
 
   // The frame number to set reference frame on
-  int update_frame_num = 0;
+  unsigned int update_frame_num = 0;
   int mismatch_seen = 0;
 
   const int fps = 30;
@@ -317,7 +317,7 @@
   const char *height_arg = NULL;
   const char *infile_arg = NULL;
   const char *outfile_arg = NULL;
-  int limit = 0;
+  unsigned int limit = 0;
   exec_name = argv[0];
 
   if (argc < 7)
diff --git a/test/cx_set_ref.sh b/test/cx_set_ref.sh
index b319bbf..678399e 100755
--- a/test/cx_set_ref.sh
+++ b/test/cx_set_ref.sh
@@ -27,7 +27,12 @@
 # $1 is the codec name.
 vpx_set_ref() {
   local codec="$1"
-  local encoder="${LIBVPX_BIN_PATH}/${codec}cx_set_ref${VPX_TEST_EXE_SUFFIX}"
+  local encoder="${LIBVPX_BIN_PATH}/vpxcx_set_ref${VPX_TEST_EXE_SUFFIX}"
+
+  if [ "$codec" = "vp8" ]; then
+    encoder="${LIBVPX_BIN_PATH}/vp8cx_set_ref${VPX_TEST_EXE_SUFFIX}"
+  fi
+
   local output_file="${VPX_TEST_OUTPUT_DIR}/${codec}cx_set_ref_${codec}.ivf"
   local ref_frame_num=90
 
@@ -36,9 +41,15 @@
     return 1
   fi
 
-  eval "${VPX_TEST_PREFIX}" "${encoder}" "${YUV_RAW_INPUT_WIDTH}" \
-      "${YUV_RAW_INPUT_HEIGHT}" "${YUV_RAW_INPUT}" "${output_file}" \
-      "${ref_frame_num}" ${devnull}
+  if [ "$codec" = "vp8" ]; then
+    eval "${VPX_TEST_PREFIX}" "${encoder}" "${YUV_RAW_INPUT_WIDTH}" \
+        "${YUV_RAW_INPUT_HEIGHT}" "${YUV_RAW_INPUT}" "${output_file}" \
+        "${ref_frame_num}" ${devnull}
+  else
+    eval "${VPX_TEST_PREFIX}" "${encoder}" "${codec}" "${YUV_RAW_INPUT_WIDTH}" \
+        "${YUV_RAW_INPUT_HEIGHT}" "${YUV_RAW_INPUT}" "${output_file}" \
+        "${ref_frame_num}" ${devnull}
+  fi
 
   [ -e "${output_file}" ] || return 1
 }