void test_generic_multiset<ValueTraits, ContainerDefiner>::test_all ()
{
   typedef typename ValueTraits::value_type value_type;
   static const int random_init[6] = { 3, 2, 4, 1, 5, 2 };
   value_cont_type values (6);
   for (int i = 0; i < 6; ++i)
      (&values[i])->value_ = random_init[i];
   typedef ContainerDefiner
      < value_type
      , value_traits<ValueTraits>
      , constant_time_size<value_type::constant_time_size>
      > definer_function;
   typedef typename definer_function::type multiset_type;
   {
      multiset_type testset(values.begin(), values.end());
      test::test_container(testset);
      testset.clear();
      testset.insert(values.begin(), values.end());
      test::test_common_unordered_and_associative_container(testset, values);
      testset.clear();
      testset.insert(values.begin(), values.end());
      test::test_associative_container(testset, values);
      testset.clear();
      testset.insert(values.begin(), values.end());
      test::test_non_unique_container(testset, values);
   }
   test_sort(values);
   test_insert(values);
   test_swap(values);
   test_find(values);
   test_impl();
   test_generic_assoc<ValueTraits, ContainerDefiner>::test_all(values);
}
void test_generic_set<ValueTraits, ContainerDefiner>::test_all()
{
   typedef typename ValueTraits::value_type value_type;
   static const int random_init[6] = { 3, 2, 4, 1, 5, 2 };
   std::vector<value_type> values (6);
   for (int i = 0; i < 6; ++i)
      values[i].value_ = random_init[i];

   typedef typename ContainerDefiner
      < value_type
      , value_traits<ValueTraits>
      , constant_time_size<value_type::constant_time_size>
      >::type set_type;
   {
      set_type testset(values.begin(), values.end());
      test::test_container(testset);
      testset.clear();
      testset.insert(values.begin(), values.end());
      test::test_common_unordered_and_associative_container(testset, values);
      testset.clear();
      testset.insert(values.begin(), values.end());
      test::test_associative_container(testset, values);
      testset.clear();
      testset.insert(values.begin(), values.end());
      test::test_unique_container(testset, values);
   }
   test_sort(values);
   test_insert(values);
   test_insert_advanced(values);
   test_swap(values);
   test_find(values);
   test_impl();
   test_generic_assoc<ValueTraits, ContainerDefiner>::test_all(values);
}
Exemple #3
0
AVS_UNIT_TEST(avs_crypto_hkdf, test_vector_1_client) {
    const unsigned char master_salt[] = {
        0x9e, 0x7c, 0xa9, 0x22, 0x23, 0x78, 0x63, 0x40
    };

    const unsigned char sender_key_info[] = {
        0x85, 0x40, 0xf6, 0x0a, 0x63, 0x4b, 0x65, 0x79,
        0x10
    };
    const unsigned char sender_key[] = {
        0xf0, 0x91, 0x0e, 0xd7, 0x29, 0x5e, 0x6a, 0xd4,
        0xb5, 0x4f, 0xc7, 0x93, 0x15, 0x43, 0x02, 0xff
    };

    test_impl(master_salt, sizeof(master_salt),
              MASTER_SECRET, sizeof(MASTER_SECRET),
              sender_key_info, sizeof(sender_key_info),
              sender_key, sizeof(sender_key));

    const unsigned char recipient_key_info[] = {
        0x85, 0x41, 0x01, 0xf6, 0x0a, 0x63, 0x4b, 0x65,
        0x79, 0x10
    };
    const unsigned char recipient_key[] = {
        0xff, 0xb1, 0x4e, 0x09, 0x3c, 0x94, 0xc9, 0xca,
        0xc9, 0x47, 0x16, 0x48, 0xb4, 0xf9, 0x87, 0x10
    };

    test_impl(master_salt, sizeof(master_salt),
              MASTER_SECRET, sizeof(MASTER_SECRET),
              recipient_key_info, sizeof(recipient_key_info),
              recipient_key, sizeof(recipient_key));


    const unsigned char common_iv_info[] = {
        0x85, 0x40, 0xf6, 0x0a, 0x62, 0x49, 0x56, 0x0d
    };
    const unsigned char common_iv[] = {
        0x46, 0x22, 0xd4, 0xdd, 0x6d, 0x94, 0x41, 0x68,
        0xee, 0xfb, 0x54, 0x98, 0x7c
    };

    test_impl(master_salt, sizeof(master_salt),
              MASTER_SECRET, sizeof(MASTER_SECRET),
              common_iv_info, sizeof(common_iv_info),
              common_iv, sizeof(common_iv));
}
Exemple #4
0
void test_colocated_calls(CORBA::ORB_ptr orb)
{
  test_i servant (orb);
  CORBA::String_var ior =
    servant.create_and_activate_server();

  test_impl(orb, ACE_TEXT_CHAR_TO_TCHAR(ior.in()), false);
}
Exemple #5
0
AVS_UNIT_TEST(avs_crypto_hkdf, test_vector_2_server) {
    const unsigned char sender_key_info[] = {
        0x85, 0x41, 0x01, 0xf6, 0x0a, 0x63, 0x4b, 0x65,
        0x79, 0x10
    };
    const unsigned char sender_key[] = {
        0xe5, 0x7b, 0x56, 0x35, 0x81, 0x51, 0x77, 0xcd,
        0x67, 0x9a, 0xb4, 0xbc, 0xec, 0x9d, 0x7d, 0xda
    };

    test_impl(NULL, 0,
              MASTER_SECRET, sizeof(MASTER_SECRET),
              sender_key_info, sizeof(sender_key_info),
              sender_key, sizeof(sender_key));

    const unsigned char recipient_key_info[] = {
        0x85, 0x41, 0x00, 0xf6, 0x0a, 0x63, 0x4b, 0x65,
        0x79, 0x10
    };
    const unsigned char recipient_key[] = {
        0x32, 0x1b, 0x26, 0x94, 0x32, 0x53, 0xc7, 0xff,
        0xb6, 0x00, 0x3b, 0x0b, 0x64, 0xd7, 0x40, 0x41
    };

    test_impl(NULL, 0,
              MASTER_SECRET, sizeof(MASTER_SECRET),
              recipient_key_info, sizeof(recipient_key_info),
              recipient_key, sizeof(recipient_key));

    const unsigned char common_iv_info[] = {
        0x85, 0x40, 0xf6, 0x0a, 0x62, 0x49, 0x56, 0x0d
    };
    const unsigned char common_iv[] = {
        0xbe, 0x35, 0xae, 0x29, 0x7d, 0x2d, 0xac, 0xe9,
        0x10, 0xc5, 0x2e, 0x99, 0xf9
    };

    test_impl(NULL, 0,
              MASTER_SECRET, sizeof(MASTER_SECRET),
              common_iv_info, sizeof(common_iv_info),
              common_iv, sizeof(common_iv));
}
Exemple #6
0
void test_remote_calls(CORBA::ORB_ptr orb)
{
  test_impl(orb, ior_argument, true);
}
Exemple #7
0
int main(int argc, char **argv)
{
	debug_init(stdout);
	save_fx(fx_orig);
	memcpy(&fx_orig[240], scratch_orig, 4*sizeof(long));
	memcpy(&fx_orig[256], taint_orig, 8*sizeof(long));
	offset = (long)taintmem_test - (long)mem_test;
	codeexec(NULL, 0, (long *)regs_orig);

	init_threads();

	test_reg2(taint_copy_reg32_to_reg32, ref_copy_reg32_to_reg32);
	test_reg2(taint_copy_reg16_to_reg16, ref_copy_reg16_to_reg16);
	test_reg2(taint_copy_reg8_to_reg8, ref_copy_reg8_to_reg8);

	test_mem(taint_copy_mem32_to_reg32, ref_copy_mem32_to_reg32);
	test_mem(taint_copy_mem16_to_reg16, ref_copy_mem16_to_reg16);
	test_mem(taint_copy_mem8_to_reg8, ref_copy_mem8_to_reg8);

	test_mem(taint_copy_reg32_to_mem32, ref_copy_reg32_to_mem32);
	test_mem(taint_copy_reg16_to_mem16, ref_copy_reg16_to_mem16);
	test_mem(taint_copy_reg8_to_mem8, ref_copy_reg8_to_mem8);

	test_stackop(taint_copy_push_reg32, ref_copy_push_reg32);
	test_stackop(taint_copy_push_reg16, ref_copy_push_reg16);

	test_mem(taint_copy_push_mem32, ref_copy_push_mem32);
	test_mem(taint_copy_push_mem16, ref_copy_push_mem16);

	test_stackop(taint_copy_pop_reg32, ref_copy_pop_reg32);
	test_stackop(taint_copy_pop_reg16, ref_copy_pop_reg16);

	test_mem(taint_copy_pop_mem32, ref_copy_pop_mem32);
	test_mem(taint_copy_pop_mem16, ref_copy_pop_mem16);

	test_addr(taint_copy_eax_to_addr32, ref_copy_eax_to_addr32);
	test_addr(taint_copy_ax_to_addr16, ref_copy_ax_to_addr16);
	test_addr(taint_copy_al_to_addr8, ref_copy_al_to_addr8);

	test_addr(taint_copy_addr32_to_eax, ref_copy_addr32_to_eax);
	test_addr(taint_copy_addr16_to_ax, ref_copy_addr16_to_ax);
	test_addr(taint_copy_addr8_to_al, ref_copy_addr8_to_al);

	test_impl(taint_copy_eax_to_str32, ref_copy_eax_to_str32);
	test_impl(taint_copy_ax_to_str16, ref_copy_ax_to_str16);
	test_impl(taint_copy_al_to_str8, ref_copy_al_to_str8);

	test_impl(taint_copy_str32_to_eax, ref_copy_str32_to_eax);
	test_impl(taint_copy_str16_to_ax, ref_copy_str16_to_ax);
	test_impl(taint_copy_str8_to_al, ref_copy_str8_to_al);

	test_impl(taint_copy_str32_to_str32, ref_copy_str32_to_str32);
	test_impl(taint_copy_str16_to_str16, ref_copy_str16_to_str16);
	test_impl(taint_copy_str8_to_str8, ref_copy_str8_to_str8);

	test_reg(taint_erase_reg32, ref_erase_reg32);
	test_reg(taint_erase_reg16, ref_erase_reg16);
	test_reg(taint_erase_reg8, ref_erase_reg8);

	test_mem(taint_erase_mem32, ref_erase_mem32);
	test_mem(taint_erase_mem16, ref_erase_mem16);
	test_mem(taint_erase_mem8, ref_erase_mem8);

	test_reg(taint_erase_hireg16, ref_erase_hireg16);

	test_impl(taint_erase_push32, ref_erase_push32);
	test_impl(taint_erase_push16, ref_erase_push16);

	test_reg2(taint_or_reg32_to_reg32, ref_or_reg32_to_reg32);
	test_reg2(taint_or_reg16_to_reg16, ref_or_reg16_to_reg16);
	test_reg2(taint_or_reg8_to_reg8, ref_or_reg8_to_reg8);

	test_mem(taint_or_reg32_to_mem32, ref_or_reg32_to_mem32);
	test_mem(taint_or_reg16_to_mem16, ref_or_reg16_to_mem16);
	test_mem(taint_or_reg8_to_mem8, ref_or_reg8_to_mem8);

	test_mem(taint_or_mem32_to_reg32, ref_or_mem32_to_reg32);
	test_mem(taint_or_mem16_to_reg16, ref_or_mem16_to_reg16);
	test_mem(taint_or_mem8_to_reg8, ref_or_mem8_to_reg8);

	test_mem(taint_xor_reg32_to_mem32, ref_xor_reg32_to_mem32);
	test_mem(taint_xor_reg16_to_mem16, ref_xor_reg16_to_mem16);
	test_mem(taint_xor_reg8_to_mem8, ref_xor_reg8_to_mem8);

	test_mem(taint_xor_mem32_to_reg32, ref_xor_mem32_to_reg32);
	test_mem(taint_xor_mem16_to_reg16, ref_xor_mem16_to_reg16);
	test_mem(taint_xor_mem8_to_reg8, ref_xor_mem8_to_reg8);

	test_reg2(taint_swap_reg32_reg32, ref_swap_reg32_reg32);
	test_reg2(taint_swap_reg16_reg16, ref_swap_reg16_reg16);
	test_reg2(taint_swap_reg8_reg8, ref_swap_reg8_reg8);

	test_mem(taint_swap_reg32_mem32, ref_swap_reg32_mem32);
	test_mem(taint_swap_reg16_mem16, ref_swap_reg16_mem16);
	test_mem(taint_swap_reg8_mem8, ref_swap_reg8_mem8);

	test_reg2(taint_copy_reg16_to_reg32, ref_copy_reg16_to_reg32);
	test_reg2(taint_copy_reg8_to_reg32, ref_copy_reg8_to_reg32);
	test_reg2(taint_copy_reg8_to_reg16, ref_copy_reg8_to_reg16);

	test_mem(taint_copy_mem16_to_reg32, ref_copy_mem16_to_reg32);
	test_mem(taint_copy_mem8_to_reg32, ref_copy_mem8_to_reg32);
	test_mem(taint_copy_mem8_to_reg16, ref_copy_mem8_to_reg16);

	test_impl2(taint_erase_eax_edx, ref_erase_eax_edx);
	test_impl2(taint_erase_ax_dx, ref_erase_ax_dx);
	test_impl2(taint_erase_eax, ref_erase_eax);
	test_impl2(taint_erase_ax, ref_erase_ax);
	test_impl2(taint_erase_al, ref_erase_al);

	test_pushpop(taint_copy_popa32, ref_copy_popa32, (long)mem_test);
	test_pushpop(taint_copy_popa16, ref_copy_popa16, (long)mem_test);

	test_pushpop(taint_copy_pusha32, ref_copy_pusha32, 32+(long)mem_test);
	test_pushpop(taint_copy_pusha16, ref_copy_pusha16, 32+(long)mem_test);

	test_impl(taint_leave32, ref_leave32);
	test_impl(taint_leave16, ref_leave16);

	test_cmpxchg(taint_cmpxchg8_pre, taint_cmpxchg8_post, ref_cmpxchg8);
	test_cmpxchg(taint_cmpxchg16_pre, taint_cmpxchg16_post, ref_cmpxchg16);
	test_cmpxchg(taint_cmpxchg32_pre, taint_cmpxchg32_post, ref_cmpxchg32);
	test_cmpxchg(taint_cmpxchg8b_pre, taint_cmpxchg8b_post, ref_cmpxchg8b);

	mrm_generator(test_lea);

	exit(err);
}