xref: /aosp_15_r20/external/google-breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.h (revision 9712c20fc9bbfbac4935993a2ca0b3958c5adad2)
1 // Copyright 2008 Google LLC
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 //     * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 //     * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following disclaimer
10 // in the documentation and/or other materials provided with the
11 // distribution.
12 //     * Neither the name of Google LLC nor the names of its
13 // contributors may be used to endorse or promote products derived from
14 // this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 //
29 //  breakpad_nlist_test.h
30 //  minidump_test
31 //
32 //  Created by Neal Sidhwaney on 4/13/08.
33 //  Copyright 2008 Google LLC
34 //
35 //
36 
37 #ifndef CLIENT_MAC_HANDLER_TESTCASES_BREAKPAD_NLIST_TEST_H__
38 #define CLIENT_MAC_HANDLER_TESTCASES_BREAKPAD_NLIST_TEST_H__
39 
40 #include <CPlusTest/CPlusTest.h>
41 
42 class BreakpadNlistTest : public TestCase {
43  private:
44 
45   // nm dumps multiple addresses for the same symbol in
46   // /usr/lib/dyld. So we track those so we don't report failures
47   // in mismatches between what our nlist returns and what nm has
48   // for the duplicate symbols.
49   bool IsSymbolMoreThanOnceInDyld(const char* symbolName);
50 
51  public:
52   explicit BreakpadNlistTest(TestInvocation* invocation);
53   virtual ~BreakpadNlistTest();
54 
55 
56   /* This test case runs nm on /usr/lib/dyld and then compares the
57      output of every symbol to what our nlist implementation returns */
58   void CompareToNM();
59 };
60 
61 #endif /* CLIENT_MAC_HANDLER_TESTCASES_BREAKPAD_NLIST_TEST_H__*/
62