2011-04-01 7 views
6

नकली वर्ग इस तरह दिखता है की एक स्टैक ट्रेस हो रही है: struct MockClass { MOCK_METHOD0 (foo, शून्य()); };C++ googlemocks: एक गैर-आरंभिकृत कॉल

मैं एक नकली वस्तु पर एक उम्मीद कॉल स्थापित करने के लिए भूल जाते हैं, मैं कुछ इस तरह मिलती है:

GMOCK WARNING: 
Uninteresting mock function call - returning directly. 
    Function call: foo() 
Stack trace: 

और स्टैक ट्रेस खाली है।

तो, स्टैक ट्रेस प्राप्त करने के लिए क्या किया जाना है?

उत्तर

9

यह वर्णन किया गया है here:

You can control how much Google Mock tells you using the --gmock_verbose=LEVEL command-line flag, where LEVEL is a string with three possible values:
1. info: Google Mock will print all informational messages, warnings, and errors (most verbose). At this setting, Google Mock will also log any calls to the ON_CALL/EXPECT_CALL macros.
2. warning: Google Mock will print both warnings and errors (less verbose). This is the default.
3. error: Google Mock will print errors only (least verbose).

Alternatively, you can adjust the value of that flag from within your tests like so:
::testing::FLAGS_gmock_verbose = "error" ;

जानकारी चेतावनी स्तर का उपयोग करना पश्व-अनुरेखन

+4

मेरे लिए काम नहीं करता है प्रिंट होगा, स्टैक ट्रेस अभी भी खाली है। – jupp0r

+0

मेरा भी खाली है – Bigbohne

संबंधित मुद्दे