<%!
import vec_test_helpers
%>\
<%def name="test_opivf(template_helper, src2, rs1, ref_vf)">
<%
src2 = vec_test_helpers.to_carr_str(src2)
ref_vf = vec_test_helpers.to_carr_str(ref_vf)
%>\
namespace softrvv_${template_helper.op_code}_vf_test {
namespace {
${insert_variable_init(template_helper, src2, rs1, ref_vf)}

class SoftRvv${template_helper.op_code.capitalize()}Test : public ::testing::Test {
 protected:
  void SetUp() override { memset(dest, 0, sizeof(dest)); }
};
${insert_test(template_helper)}\
}  // namespace
}  // namespace softrvv_${op}_vf_test\
</%def>\

<%def name="insert_variable_init(template_helper, src2, rs1, ref_vf)">
<%
  var_types = template_helper.get_var_types()
%>\
${var_types.src2_type} src2[] = {${src2}};
${var_types.imm_type} rs1 = ${rs1};
const int kAVL = sizeof(src2)/sizeof(src2[0]);
${var_types.dest_type} dest[kAVL];

${var_types.dest_type} ref_vf[kAVL] = {${ref_vf}};
</%def>\

<%def name="insert_test(template_helper)">
<%
var_types = template_helper.get_var_types()
datatypes = template_helper.get_softrvv_template_data_type()
%>\

TEST_F(SoftRvv${template_helper.op_code.capitalize()}Test, VF) {
  softrvv::${template_helper.op_code}_vf(dest, src2, &rs1, kAVL);\
${insert_check(template_helper, var_types.dest_type, "ref_vf")}\
}
</%def>\

<%def name="insert_check(template_helper, dest_type, ref_var)">
% if template_helper.is_destination_mask_register():
  assert_vec_mask_eq<${dest_type}>(kAVL, dest, ${ref_var});
% else:
  assert_vec_elem_eq<${dest_type}>(kAVL, dest, ${ref_var});
% endif
</%def>\
