diff --git a/tests/test_paramdict.cpp b/tests/test_paramdict.cpp index e30663cafd7..503de188e17 100644 --- a/tests/test_paramdict.cpp +++ b/tests/test_paramdict.cpp @@ -40,7 +40,7 @@ int ParamDictTest::load_param_bin(const unsigned char* mem) static int test_paramdict_0() { ParamDictTest pdt; - pdt.load_param("0=100 1=1,-1,4,5,1,4 2=1.250000 -23303=5,0.1,0.2,-0.4,0.8,1.0"); + pdt.load_param("0=100 1=1,-1,4,5,1,4 2=1.250000 -23303=5,0.1,0.2,-0.4,0.8,1.0 -23304=3,-1,10,-88"); // int int typei = pdt.type(0); @@ -109,6 +109,26 @@ static int test_paramdict_0() return -1; } + // int array + typeai = pdt.type(4); + if (typeai != 5) + { + fprintf(stderr, "test_paramdict int array type failed %d != 5\n", typeai); + return -1; + } + ai = pdt.get(4, ncnn::Mat()); + if (ai.w != 3) + { + fprintf(stderr, "test_paramdict int array size failed %d != 3\n", ai.w); + return -1; + } + p = ai; + if (p[0] != -1 || p[1] != 10 || p[2] != -88) + { + fprintf(stderr, "test_paramdict int array value failed %d %d %d\n", p[0], p[1], p[2]); + return -1; + } + return 0; } @@ -627,7 +647,8 @@ static int test_paramdict_6() // assign { - ncnn::ParamDict pd = pd0; + ncnn::ParamDict pd; + pd = pd0; int ret = compare_paramdict(pd, pd0); if (ret != 0)