pike.git / lib / modules / Standards.pmod / ASN1.pmod / testsuite.in

version» Context lines:

pike.git/lib/modules/Standards.pmod/ASN1.pmod/testsuite.in:14:    case "":    return sprintf("%O",o)-"Standards.ASN1."-"Types.";    default:    return o->type_name + "(" + o->value + ")";    }   }); )      test_eval_error(Standards.ASN1.Decode.simple_der_decode(""))      test_eval_error(Standards.ASN1.Decode.simple_der_decode("")) - test_eval_error(Standards.ASN1.Decode.secure_der_decode("")) + test_eq(Standards.ASN1.Decode.secure_der_decode(""), 0)      test_eval_error(Standards.ASN1.Decode.simple_der_decode(String.hex2string("a2184515521e4c5d26f05590543c696ca2bd04b7754a18107d7f62744fbcb3a52ee80de3dca53339c3f6b2196afe3c540adfeb92686029f2"))) - test_eval_error(Standards.ASN1.Decode.secure_der_decode(String.hex2string("a2184515521e4c5d26f05590543c696ca2bd04b7754a18107d7f62744fbcb3a52ee80de3dca53339c3f6b2196afe3c540adfeb92686029f2"))) + test_eq(Standards.ASN1.Decode.secure_der_decode(String.hex2string("a2184515521e4c5d26f05590543c696ca2bd04b7754a18107d7f62744fbcb3a52ee80de3dca53339c3f6b2196afe3c540adfeb92686029f2")), 0)      define(test_decode,[[    test_eq(P(Standards.ASN1.Decode.simple_der_decode(String.hex2string($1))),$2)    test_eq(Standards.ASN1.Decode.simple_der_decode(String.hex2string($1))->get_der(),    String.hex2string($1))    test_eq(decode_value(encode_value(Standards.ASN1.Decode.simple_der_decode(String.hex2string($1-" "))))->get_der(),    String.hex2string($1))   ]])      test_decode("1f 7f 00", "Decode.Primitive(508)")
pike.git/lib/modules/Standards.pmod/ASN1.pmod/testsuite.in:216:    Types.Identifier(1,2,1,1),    Types.Identifier(1,2,2),    Types.Identifier(1,3),   }) ]])      test_eq(Standards.ASN1.Decode.secure_der_decode("\1\1\0")->get_der(),   "\1\1\0")   test_eq(Standards.ASN1.Decode.secure_der_decode("\1\1\0\0"), 0)      test_any([[ +  string sig = String.hex2string("3082003d021d00a545d62d6e336775fb6a9b8495721646a54bd8c6173fc0a2295a1b7b021c068259cf902e5d55eb26e7bf850a82d40fc5456b3a902679612ea4a8"); +  +  object o = Standards.ASN1.Decode.simple_der_decode(sig); +  if( o[0]->value != 17405257248838891816469921369101584473558545790090909834630401760123 ) return 0; +  if( o[1]->value != 685496968505591163571084568128572561995827594072077741814321161384 ) return 0; +  o = Standards.ASN1.Decode.secure_der_decode(sig); +  return 1; + ]], 1) +  + test_any([[    // Sequence(Integer(4),Integer(7))    Types.Sequence s = Standards.ASN1.Decode.simple_der_decode("0\6\2\1\4\2\1\a");    s->elements[0] = Types.Integer(8);    return s->get_der();   ]], "0\6\2\1\b\2\1\a")      test_decode("170d3338303131393033313430385a", "UTCTime(380119031408Z)")   test_eq(Types.UTC()->set_posix(1<<31)->get_der(), "\27\r380119031408Z")   test_eval_error(Types.UTC()->set_posix(1<<32))