Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(143)

Delta Between Two Patch Sets: misc/cgo/test/issue5548.go

Issue 160200044: [dev.power64] code review 160200044: build: merge default into dev.power64 (Closed)
Left Patch Set: diff -r be0c14f62257b42485019e9e1db23cf40d2e249f https://code.google.com/p/go Created 10 years, 4 months ago
Right Patch Set: diff -r be0c14f62257b42485019e9e1db23cf40d2e249f https://code.google.com/p/go Created 10 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « misc/cgo/test/issue5242.go ('k') | misc/cgo/test/issue7695_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2013 The Go Authors. All rights reserved. 1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package cgotest 5 package cgotest
6 6
7 import "testing" 7 import "testing"
8 8
9 /* 9 /*
10 extern int issue5548_in_c(void); 10 extern int issue5548_in_c(void);
11 */ 11 */
12 import "C" 12 import "C"
13 13
14 //export issue5548FromC 14 //export issue5548FromC
15 func issue5548FromC(s string, i int) int { 15 func issue5548FromC(s string, i int) int {
16 if len(s) == 4 && s == "test" && i == 42 { 16 if len(s) == 4 && s == "test" && i == 42 {
17 » » return 1 17 » » return 12345
18 } 18 }
19 » return 0 19 » println("got", len(s), i)
20 » return 9876
20 } 21 }
21 22
22 func test5548(t *testing.T) { 23 func test5548(t *testing.T) {
23 » if C.issue5548_in_c() == 0 { 24 » if x := C.issue5548_in_c(); x != 12345 {
24 » » t.Fail() 25 » » t.Errorf("issue5548_in_c = %d, want %d", x, 12345)
25 } 26 }
26 } 27 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b