diff --git a/test/src/cpp11/ringbuffer_test.cpp b/test/src/cpp11/ringbuffer_test.cpp new file mode 100644 index 0000000..f1cb8b0 --- /dev/null +++ b/test/src/cpp11/ringbuffer_test.cpp @@ -0,0 +1,120 @@ +/* + * @Author: your name + * @Date: 2021-10-09 10:03:45 + * @LastEditTime: 2021-12-01 14:48:38 + * @LastEditors: your name + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @FilePath: \cpp11\template.cpp + */ +#include "iostream" +#include +#include "pattern/ringbuffer.hpp" +#include +#include + +using namespace std; + + +void TestShuffle(){ + int in[1024]; + for(int j = 0;j < 1024;j++){ + in[j] = j; + } + int out[1024]; + RingBuffer ring(1024,false); + int size = 0; + for(int i = 0;i < 10;i++){ + int tmp = rand(); + std::cout< x(1024,false); + + for(int i = 0;i < 10;i++){ + std::cout< x(1024,true); + + for(int i = 0;i < 10;i++){ + std::cout<