Compare commits

..

No commits in common. "698740e20a994c31bf32834e56a1fdac9fae85ac" and "6f2a65dac9367c18bfbdc61b1e4042e343bc2227" have entirely different histories.

3 changed files with 7 additions and 47 deletions

View File

@ -7,9 +7,3 @@
Replace "Get" by "get" in messages.pb.go Replace "Get" by "get" in messages.pb.go
gomobile bind -target android -androidapi=19 gomobile bind -target android -androidapi=19
Look at the exported API and cry...
## Other option
GOOS=android GOARCH=arm64 go build -buildmode=c-archive -o libmeow.a

View File

@ -35,9 +35,9 @@ type Config struct {
DbSuffix string `json:"db_suffix,omitempty"` DbSuffix string `json:"db_suffix,omitempty"`
// Inner // Inner
memoryPassword string memoryPassword string `json:"memory_password,omitempty"`
additionalPasswords []string additionalPasswords []string `json:"additional_passwords,omitempty"`
me *Identity me *Identity `json:"me,omitempty"`
} }
var instance *Config var instance *Config
@ -82,14 +82,6 @@ func (c *Config) GetMemPass() string {
return c.memoryPassword return c.memoryPassword
} }
func (c *Config) GetIdentity() *Identity {
return c.me
}
func (c *Config) SetIdentity(id *Identity) {
c.me = id
}
func (c *Config) SaveIdentity() error { func (c *Config) SaveIdentity() error {
return c.me.Save() return c.me.Save()
} }

View File

@ -38,35 +38,9 @@ func TestStoreMessage(t *testing.T) {
panic(err) panic(err)
} }
} }
} }
func TestManyStoreMessage(t *testing.T) { func TestGetLastMessages(t *testing.T) {
id := createId()
for i := 1; i < 100; i++ {
var um meowlib.UserMessage
um.Data = []byte(randomLenString(20, 200))
err := StoreMessage(&id.Peers[0], &um, GetConfig().memoryPassword)
if err != nil {
log.Fatal(err)
}
}
messages, err := GetLastMessages(&id.Peers[0], 0, 0, 10, GetConfig().memoryPassword)
if err != nil {
log.Fatal(err)
}
// Checks
assert.Equal(t, len(messages), 10, "not 10 message")
// Cleanup
if exists("test.id") {
os.Remove("test.id")
}
files, err := filepath.Glob("*.sqlite")
if err != nil {
panic(err)
}
for _, f := range files {
if err := os.Remove(f); err != nil {
panic(err)
}
}
} }