本文整理匯總了Golang中github.com/motain/gocheck.C.Fatalf方法的典型用法代碼示例。如果您正苦於以下問題:Golang C.Fatalf方法的具體用法?Golang C.Fatalf怎麽用?Golang C.Fatalf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/motain/gocheck.C
的用法示例。
在下文中一共展示了C.Fatalf方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestMultiComplete
// This may take a minute or more due to the minimum size accepted S3
// on multipart upload parts.
func (s *ClientTests) TestMultiComplete(c *gocheck.C) {
b := testBucket(s.s3)
err := b.PutBucket(s3.Private)
c.Assert(err, gocheck.IsNil)
multi, err := b.InitMulti("multi", "text/plain", s3.Private)
c.Assert(err, gocheck.IsNil)
c.Assert(multi.UploadId, gocheck.Matches, ".+")
defer multi.Abort()
// Minimum size S3 accepts for all but the last part is 5MB.
data1 := make([]byte, 5*1024*1024)
data2 := []byte("<part 2>")
part1, err := multi.PutPart(1, bytes.NewReader(data1))
c.Assert(err, gocheck.IsNil)
part2, err := multi.PutPart(2, bytes.NewReader(data2))
c.Assert(err, gocheck.IsNil)
// Purposefully reversed. The order requirement must be handled.
err = multi.Complete([]s3.Part{part2, part1})
c.Assert(err, gocheck.IsNil)
data, err := b.Get("multi")
c.Assert(err, gocheck.IsNil)
c.Assert(len(data), gocheck.Equals, len(data1)+len(data2))
for i := range data1 {
if data[i] != data1[i] {
c.Fatalf("uploaded object at byte %d: want %d, got %d", data1[i], data[i])
}
}
c.Assert(string(data[len(data1):]), gocheck.Equals, string(data2))
}
示例2: TestEmptyQuery
func (s *QueryBuilderSuite) TestEmptyQuery(c *gocheck.C) {
q := dynamodb.NewEmptyQuery()
queryString := q.String()
expectedString := "{}"
c.Check(queryString, gocheck.Equals, expectedString)
if expectedString != queryString {
c.Fatalf("Unexpected Query String : %s\n", queryString)
}
}
示例3: makeTestGroup
func (s *ServerTests) makeTestGroup(c *gocheck.C, name, descr string) ec2.SecurityGroup {
// Clean it up if a previous test left it around.
_, err := s.ec2.DeleteSecurityGroup(ec2.SecurityGroup{Name: name})
if err != nil && err.(*ec2.Error).Code != "InvalidGroup.NotFound" {
c.Fatalf("delete security group: %v", err)
}
resp, err := s.ec2.CreateSecurityGroup(ec2.SecurityGroup{Name: name, Description: descr})
c.Assert(err, gocheck.IsNil)
c.Assert(resp.Name, gocheck.Equals, name)
return resp.SecurityGroup
}
示例4: TestUnmarshalEmptySets
func (s *MarshallerSuite) TestUnmarshalEmptySets(c *gocheck.C) {
testObj := &TestStruct{}
attrMap := map[string]*dynamodb.Attribute{}
attrs := testAttrsWithNilSets()
for i, _ := range attrs {
attrMap[attrs[i].Name] = &attrs[i]
}
err := dynamodb.UnmarshalAttributes(&attrMap, testObj)
if err != nil {
c.Fatalf("Error from dynamodb.UnmarshalAttributes: %#v (Built: %#v)", err, testObj)
}
expected := testObjectWithNilSets()
c.Check(testObj, gocheck.DeepEquals, expected)
}