Cっぽいコードでgoogle testとgoogle mockを使ってみる
Cっぽいコードでgtestとgmockを使ってみる クラスとか使っていないコードでgtest, ついでにgmockを使うことができないか試してみたのでメモ。 参考にした情報 以下の情報を参考にさせていただきました。ありがとうございます。 ブログ sioaji2012のブログ - 組込C言語でUnitTest 5 GoogleMock 書籍 モダンC言語プログラミング 元のコード 我ながらCだかC++だか分からないコードですが・・・ capsule.h # include <iostream> # include <stdint.h> # ifndef CAPSULE_H_ # define CAPSULE_H_ // Prototype for public function void publicMethod ( const uint8_t input , uint8_t & output ) ; # endif // CAPSULE_H_ capsule.cpp # include "capsule.h" // Prototype for private function static void privateMethod01 ( const uint8_t input , uint8_t & output ) ; // Implement for public function void publicMethod ( const uint8_t input , uint8_t & output ) { std :: cout << "publicMethod called." << std :: endl ; // call private function privateMethod01 ( input , output ) ; return ; } // Implement for private function static void privateMethod01 ( con...
コメント
コメントを投稿