Computer/C
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
''&size(24){&color(olive){C};};''
#topicpath
#contents
#br
** CppUnitをVC++で使用する方法 [#g954ceec]
*** はじめに [#ide2649e]
- CppUnitの基本的な使用方法についてはCppUnit 入門 http://...
- このサイトでVC++についても言及してあるのですがVC++のバ...
- Visual C++ 2003以降を用いた場合の方法を示します。
*** CppUnitの準備 [#oeb5b645]
- Source Forge https://sourceforge.jp/projects/cppunit-x/...
- 適当なフォルダ,例えばC:\cppunit-x-20020331などに展開し...
- C:\cppunit-x-20020331\msvc\cppunit.dswを開いてビルドし...
*** テスト [#g24cfc90]
- CppUnit 入門サイトにて配布されているdicegame-0.2.zipを...
- 同ファイルを展開し,dicegame-0.2\msvc\dicegame.dswを開...
- 古い形式を新しい形式に変換するかどうか聞かれるのですべ...
- ソリューションエクスプローラのdicegame_testsのコンテキ...
- 構成プロパティのC/C++の全般で,追加のインクルードディレ...
- 構成プロパティのリンカの入力で,追加の依存ファイルにC:\...
- ソリューションをビルドするとdicegame-0.2\msvc\dicegame_...
- cmdから実行すると以下の出力が得られます。
D:\>dicegame_tests.exe
.F
.F
.F
!!!FAILURES!!!
Test Results:
Run: 3, Failures: 3, Errors: 0
There were 3 failures:
1) DiceGamePlayerTest::testCreate (dicegameplayertest.cp...
expected:<0> but was:<-858993460>
2) DiceGamePlayerTest::testWinGame (dicegameplayertest.c...
expected:<0> but was:<-858993460>
3) DiceGamePlayerTest::testLoseGame (dicegameplayertest....
expected:<0> but was:<-858993460>
** 疑似C++クラス [#ae7e8e16]
- test.c
#include <stdio.h>
typedef struct _class_hoge {
int member;
int (*get_member)(void* this);
} class_hoge;
int get_member(void* this) {
return (class_hoge*)this->member;
}
void class_hoge_init(class_hoge* this) {
this->member = 123;
this->get_member = get_member;
}
int main(void) {
class_hoge hoge;
hoge.get_member(&hoge);
}
終了行:
''&size(24){&color(olive){C};};''
#topicpath
#contents
#br
** CppUnitをVC++で使用する方法 [#g954ceec]
*** はじめに [#ide2649e]
- CppUnitの基本的な使用方法についてはCppUnit 入門 http://...
- このサイトでVC++についても言及してあるのですがVC++のバ...
- Visual C++ 2003以降を用いた場合の方法を示します。
*** CppUnitの準備 [#oeb5b645]
- Source Forge https://sourceforge.jp/projects/cppunit-x/...
- 適当なフォルダ,例えばC:\cppunit-x-20020331などに展開し...
- C:\cppunit-x-20020331\msvc\cppunit.dswを開いてビルドし...
*** テスト [#g24cfc90]
- CppUnit 入門サイトにて配布されているdicegame-0.2.zipを...
- 同ファイルを展開し,dicegame-0.2\msvc\dicegame.dswを開...
- 古い形式を新しい形式に変換するかどうか聞かれるのですべ...
- ソリューションエクスプローラのdicegame_testsのコンテキ...
- 構成プロパティのC/C++の全般で,追加のインクルードディレ...
- 構成プロパティのリンカの入力で,追加の依存ファイルにC:\...
- ソリューションをビルドするとdicegame-0.2\msvc\dicegame_...
- cmdから実行すると以下の出力が得られます。
D:\>dicegame_tests.exe
.F
.F
.F
!!!FAILURES!!!
Test Results:
Run: 3, Failures: 3, Errors: 0
There were 3 failures:
1) DiceGamePlayerTest::testCreate (dicegameplayertest.cp...
expected:<0> but was:<-858993460>
2) DiceGamePlayerTest::testWinGame (dicegameplayertest.c...
expected:<0> but was:<-858993460>
3) DiceGamePlayerTest::testLoseGame (dicegameplayertest....
expected:<0> but was:<-858993460>
** 疑似C++クラス [#ae7e8e16]
- test.c
#include <stdio.h>
typedef struct _class_hoge {
int member;
int (*get_member)(void* this);
} class_hoge;
int get_member(void* this) {
return (class_hoge*)this->member;
}
void class_hoge_init(class_hoge* this) {
this->member = 123;
this->get_member = get_member;
}
int main(void) {
class_hoge hoge;
hoge.get_member(&hoge);
}
ページ名: