c++ designpattern test