Migration WordPress from 5.2.1 to 5.7.1

Ok guys, I just made a mistake and broken my blog few days ago, but finally, as it get back to normal, so let me show you what’s happening. It is beginning from a mad idea, I upgraded my vps OS to ubuntu 12.04, after that, I found that the php-fpm process has broken(due to … Read more

Valgrind is not friendly for swapcontext

Okie, long time no see … I write this only better for me to remember something what happend, something what I want to share. This is an experience what I’ve troubled, last week, when I tested my program about c-coroutine library, I found that a lot of critical informations in the output of valgrind. for … Read more

How to Write a Simple UnitTest Framework

很多时候, 我们需要UnitTest帮助我们快速的发现代码修改中引发的问题, UnitTest的意义以及重要性已经无需重复, 那么在实际项目中, 我们会选取合适的UnitTest Framework帮助我们完成这项工作, 然而UnitTest Framework也有很多种, 挑选的时候大多根据项目需要, 不过大家是否有冲动自己写一个那? 来一探UnitTest Framework的究竟(本文将实现一个C语言的UnitTest Framework 代码放置在https://github.com/finaldie/final_libs的ftu中). 原理: UnitTest Framework通常帮助我们完成以下几种功能: 1. 提供常用assert API 2. 注册执行test case 3. 生成report 关于断言, 我们通常使用几种形式的断言, 比如: 1. 某个值是否于期望值相等 2. 某个值是否大于期望值 3. 某个值是否小于期望值 所以, 如果我们自己来写一个, 只需要提供基本的assert API, 注册和执行的API即可(最后的报告放在run API内部即可). WorkFlow: 实现:   原理清楚了, 实现起来就很容易了. 首先我们先来提供几个基本的assert API: extern int curr_failed_assert; extern int curr_total_assert; #define FTU_ASSERT_EQUAL_CHAR(expect, real) \ … Read more