| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
package pkg |
| 8 |
|
| 9 |
import ( |
| 10 |
fmt "fmt" |
| 11 |
oglemock "github.com/jacobsa/oglemock" |
| 12 |
tony "github.com/jacobsa/oglemock/generate/testdata/renamed_pkg" |
| 13 |
runtime "runtime" |
| 14 |
unsafe "unsafe" |
| 15 |
) |
| 16 |
|
| 17 |
type MockSomeInterface interface { |
| 18 |
tony.SomeInterface |
| 19 |
oglemock.MockObject |
| 20 |
} |
| 21 |
|
| 22 |
type mockSomeInterface struct { |
| 23 |
controller oglemock.Controller |
| 24 |
description string |
| 25 |
} |
| 26 |
|
| 27 |
func NewMockSomeInterface( |
| 28 |
c oglemock.Controller, |
| 29 |
desc string) MockSomeInterface { |
| 30 |
return &mockSomeInterface{ |
| 31 |
controller: c, |
| 32 |
description: desc, |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
func (m *mockSomeInterface) Oglemock_Id() uintptr { |
| 37 |
return uintptr(unsafe.Pointer(m)) |
| 38 |
} |
| 39 |
|
| 40 |
func (m *mockSomeInterface) Oglemock_Description() string { |
| 41 |
return m.description |
| 42 |
} |
| 43 |
|
| 44 |
func (m *mockSomeInterface) DoFoo(p0 int) (o0 int) { |
| 45 |
|
| 46 |
_, file, line, _ := runtime.Caller(1) |
| 47 |
|
| 48 |
|
| 49 |
retVals := m.controller.HandleMethodCall( |
| 50 |
m, |
| 51 |
"DoFoo", |
| 52 |
file, |
| 53 |
line, |
| 54 |
[]interface{}{p0}) |
| 55 |
|
| 56 |
if len(retVals) != 1 { |
| 57 |
panic(fmt.Sprintf("mockSomeInterface.DoFoo: invalid return values: %v", retVals)) |
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
if retVals[0] != nil { |
| 62 |
o0 = retVals[0].(int) |
| 63 |
} |
| 64 |
|
| 65 |
return |
| 66 |
} |