provide follow features implementation:
[o-du/phy.git] / fhi_lib / test / test_xran / unittests.cc
diff --git a/fhi_lib/test/test_xran/unittests.cc b/fhi_lib/test/test_xran/unittests.cc
new file mode 100644 (file)
index 0000000..bf543a4
--- /dev/null
@@ -0,0 +1,43 @@
+/******************************************************************************\r
+*\r
+*   Copyright (c) 2019 Intel.\r
+*\r
+*   Licensed under the Apache License, Version 2.0 (the "License");\r
+*   you may not use this file except in compliance with the License.\r
+*   You may obtain a copy of the License at\r
+*\r
+*       http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+*   Unless required by applicable law or agreed to in writing, software\r
+*   distributed under the License is distributed on an "AS IS" BASIS,\r
+*   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+*   See the License for the specific language governing permissions and\r
+*   limitations under the License.\r
+*\r
+*******************************************************************************/\r
+\r
+#include <limits.h>\r
+#include "xran_compression.h"\r
+#include "gtest/gtest.h"\r
+\r
+#define MAX_IQ (273*12*2)// 273 RBs, 12 SC, 32bits IQ\r
+\r
+int8_t iCompressionOutput_AVX_A[MAX_IQ + MAX_IQ/24]; /* 273 RB 8 bits IQ + exponent */\r
+int16_t iDeCompressionOutput_AVX_A[MAX_IQ]; /* 273 RB 16bits IQ */\r
+int16_t iCompressionInput[MAX_IQ]; /* 273 RB 16bits IQ */\r
+int16_t iLength = 273*12*2; // total 16bits IQ\r
+\r
+// Tests\r
+/*\r
+TEST(Compression, Zero) {\r
+  EXPECT_EQ(0, xran_bfp_comp_avx512_fun_a(iCompressionInput,iCompressionOutput_AVX_A, iLength));\r
+}\r
+\r
+\r
+\r
+TEST(Decompression, Zero) {\r
+    iLength= 24+1;\r
+    EXPECT_EQ(0, xran_bfp_decomp_avx512_fun_a(iCompressionOutput_AVX_A,iDeCompressionOutput_AVX_A,iLength));\r
+}*/\r
+\r
+\r